Re: [RFC PATCH 00/18] TTM interface for managing VRAM oversubscription
Hey, Den 2024-04-24 kl. 18:56, skrev Friedrich Vock: Hi everyone, recently I've been looking into remedies for apps (in particular, newer games) that experience significant performance loss when they start to hit VRAM limits, especially on older or lower-end cards that struggle to fit both desktop apps and all the game data into VRAM at once. The root of the problem lies in the fact that from userspace's POV, buffer eviction is very opaque: Userspace applications/drivers cannot tell how oversubscribed VRAM is, nor do they have fine-grained control over which buffers get evicted. At the same time, with GPU APIs becoming increasingly lower-level and GPU-driven, only the application itself can know which buffers are used within a particular submission, and how important each buffer is. For this, GPU APIs include interfaces to query oversubscription and specify memory priorities: In Vulkan, oversubscription can be queried through the VK_EXT_memory_budget extension. Different buffers can also be assigned priorities via the VK_EXT_pageable_device_local_memory extension. Modern games, especially D3D12 games via vkd3d-proton, rely on oversubscription being reported and priorities being respected in order to perform their memory management. However, relaying this information to the kernel via the current KMD uAPIs is not possible. On AMDGPU for example, all work submissions include a "bo list" that contains any buffer object that is accessed during the course of the submission. If VRAM is oversubscribed and a buffer in the list was evicted to system memory, that buffer is moved back to VRAM (potentially evicting other unused buffers). Since the usermode driver doesn't know what buffers are used by the application, its only choice is to submit a bo list that contains every buffer the application has allocated. In case of VRAM oversubscription, it is highly likely that some of the application's buffers were evicted, which almost guarantees that some buffers will get moved around. Since the bo list is only known at submit time, this also means the buffers will get moved right before submitting application work, which is the worst possible time to move buffers from a latency perspective. Another consequence of the large bo list is that nearly all memory from other applications will be evicted, too. When different applications (e.g. game and compositor) submit work one after the other, this causes a ping-pong effect where each app's submission evicts the other app's memory, resulting in a large amount of unnecessary moves. This overly aggressive eviction behavior led to RADV adopting a change that effectively allows all VRAM applications to reside in system memory [1]. This worked around the ping-ponging/excessive buffer moving problem, but also meant that any memory evicted to system memory would forever stay there, regardless of how VRAM is used. My proposal aims at providing a middle ground between these extremes. The goals I want to meet are: - Userspace is accurately informed about VRAM oversubscription/how much VRAM has been evicted - Buffer eviction respects priorities set by userspace - Wasteful ping-ponging is avoided to the extent possible I have been testing out some prototypes, and came up with this rough sketch of an API: - For each ttm_resource_manager, the amount of evicted memory is tracked (similarly to how "usage" tracks the memory usage). When memory is evicted via ttm_bo_evict, the size of the evicted memory is added, when memory is un-evicted (see below), its size is subtracted. The amount of evicted memory for e.g. VRAM can be queried by userspace via an ioctl. - Each ttm_resource_manager maintains a list of evicted buffer objects. - ttm_mem_unevict walks the list of evicted bos for a given ttm_resource_manager and tries moving evicted resources back. When a buffer is freed, this function is called to immediately restore some evicted memory. - Each ttm_buffer_object independently tracks the mem_type it wants to reside in. - ttm_bo_try_unevict is added as a helper function which attempts to move the buffer to its preferred mem_type. If no space is available there, it fails with -ENOSPC/-ENOMEM. - Similar to how ttm_bo_evict works, each driver can implement uneviction_valuable/unevict_flags callbacks to control buffer un-eviction. This is what patches 1-10 accomplish (together with an amdgpu implementation utilizing the new API). Userspace priorities could then be implemented as follows: - TTM already manages priorities for each buffer object. These priorities can be updated by userspace via a GEM_OP ioctl to inform the kernel which buffers should be evicted before others. If an ioctl increases the priority of a buffer, ttm_bo_try_unevict is called on that buffer to try and move it back (potentially evicting buffers with a lower priority) - Buffers should never be evicted by other buffers with equal/lower priority, but
[PULL] drm-misc-next
Hi Dave, Sima, One more pull request for v6.10! Cheers, ~Maarten drm-misc-next-2024-04-25: drm-misc-next for v6.10-rc1: UAPI Changes: Cross-subsystem Changes: - Devicetree updates for rockchip (#sound-dai-cells) - Add dt bindings for new panels. - Change bridge/tc358775 dt bindings. Core Changes: - Fix SIZE_HINTS cursor property doc. - Parse topology blocks for all DispID < 2.0. - Implement support for tracking cleared free memory, use it in amdgpu. - Drop seq_file.h from drm_print.h, and include debugfs.h explicitly where needed (drivers). Driver Changes: - Small fixes to rockchip, panthor, v3d, bridge chaining, xlx. - Add Khadas TS050 V2, EDO RM69380 OLED, CSOT MNB601LS1-1 panels, - Add SAM9X7 SoC's LVDS controller. - More driver conversions to struct drm_edid. - Support tc358765 in tc358775 bridge. The following changes since commit 0208ca55aa9c9b997da1f5bc45c4e98916323f08: Backmerge tag 'v6.9-rc5' into drm-next (2024-04-22 14:35:52 +1000) are available in the Git repository at: https://gitlab.freedesktop.org/drm/misc/kernel.git tags/drm-misc-next-2024-04-25 for you to fetch changes up to 9e2b84fb6cd7ee913aa61d461db65c1d6a08dcf2: drm/print: drop include seq_file.h (2024-04-25 17:05:48 +0300) drm-misc-next for v6.10-rc1: UAPI Changes: Cross-subsystem Changes: - Devicetree updates for rockchip (#sound-dai-cells) - Add dt bindings for new panels. - Change bridge/tc358775 dt bindings. Core Changes: - Fix SIZE_HINTS cursor property doc. - Parse topology blocks for all DispID < 2.0. - Implement support for tracking cleared free memory, use it in amdgpu. - Drop seq_file.h from drm_print.h, and include debugfs.h explicitly where needed (drivers). Driver Changes: - Small fixes to rockchip, panthor, v3d, bridge chaining, xlx. - Add Khadas TS050 V2, EDO RM69380 OLED, CSOT MNB601LS1-1 panels, - Add SAM9X7 SoC's LVDS controller. - More driver conversions to struct drm_edid. - Support tc358765 in tc358775 bridge. Adam Ford (1): drm/bridge: imx: Fix unmet depenency for PHY_FSL_SAMSUNG_HDMI_PHY Anatoliy Klymenko (6): drm: xlnx: zynqmp_dpsub: Set layer mode during creation drm: xlnx: zynqmp_dpsub: Update live format defines drm: xlnx: zynqmp_dpsub: Add connected live layer helper drm: xlnx: zynqmp_dpsub: Anounce supported input formats drm: xlnx: zynqmp_dpsub: Minimize usage of global flag drm: xlnx: zynqmp_dpsub: Set input live format Andy Yan (1): drm/rockchip: lvds: Remove include of drm_dp_helper.h Arunpravin Paneer Selvam (3): drm/buddy: Implement tracking clear page feature drm/amdgpu: Enable clear page functionality drm/tests: Add a test case for drm buddy clear allocation Barnabás Czémán (1): drm/panel: jdi-fhd-r63452: make use of prepare_prev_first Dan Carpenter (1): drm/panthor: clean up some types in panthor_sched_suspend() David Wronek (2): dt-bindings: display: panel: Add Raydium RM69380 drm/panel: Add driver for EDO RM69380 OLED panel Detlev Casanova (1): drm/rockchip: vop2: Do not divide height twice for YUV Dharma Balasubiramani (3): dt-bindings: display: bridge: add sam9x75-lvds binding drm/bridge: add lvds controller support for sam9x7 MAINTAINERS: add SAM9X7 SoC's LVDS controller Dmitry Baryshkov (5): drm/panel: novatek-nt36672e: stop setting register load before disable drm/panel: novatek-nt36672e: stop calling regulator_set_load manually drm/panel: novatek-nt36672a: stop calling regulator_set_load manually drm/panel: visionox-rm69299: stop calling regulator_set_load manually drm/bridge: adv7511: make it honour next bridge in DT Jacobe Zang (2): dt-bindings: panel-simple-dsi: add Khadas TS050 V2 panel drm/panel: add Khadas TS050 V2 panel support Jani Nikula (11): drm/panel: simple: switch to struct drm_edid drm/panel-samsung-atna33xc20: switch to struct drm_edid drm/panel-edp: switch to struct drm_edid drm/sun4i: hdmi: switch to struct drm_edid drm/vc4: hdmi: switch to struct drm_edid drm/gud: switch to struct drm_edid drm/rockchip: cdn-dp: switch to struct drm_edid drm/rockchip: inno_hdmi: switch to struct drm_edid drm/rockchip: rk3066_hdmi: switch to struct drm_edid drm/print: drop include debugfs.h and include where needed drm/print: drop include seq_file.h Johan Jonker (3): dt-bindings: display: add #sound-dai-cells property to rockchip dw hdmi dt-bindings: display: add #sound-dai-cells property to rockchip rk3066 hdmi dt-bindings: display: add #sound-dai-cells property to rockchip inno hdmi Krzysztof Kozlowski (3): drm/rockchip: cdn-dp: drop driver owner assignment drm/bridge: chipone-icn6211: drop driver owner assignment drm/bridge: tc358764: drop driver owner
[PULL] drm-misc-next
Hi Dave, Sima, Bit late, but with slightly more content. Cheers, ~Maarten drm-misc-next-2024-04-19: drm-misc-next for v6.10-rc1: UAPI Changes: - Add SIZE_HINTS property for cursor planes. Cross-subsystem Changes: Core Changes: - Document the requirements and expectations of adding new driver-specific properties. - Assorted small fixes to ttm. - More Kconfig fixes. - Add struct drm_edid_product_id and helpers. - Use drm device based logging in more drm functions. - Fixes for drm-panic, and option to test it. - Assorted small fixes and updates to edid. - Add drm_crtc_vblank_crtc and use it in vkms, nouveau. Driver Changes: - Assorted small fixes and improvements to bridge/imx8mp-hdmi-tx, nouveau, ast, qaic, lima, vc4, bridge/anx7625, mipi-dsi. - Add drm panic to simpledrm, mgag200, imx, ast. - Use dev_err_probe in bridge/panel drivers. - Add Innolux G121X1-L03, LG sw43408 panels. - Use struct drm_edid in i915 bios parsing. The following changes since commit 29b39672bc1d651010f7b61e106d51998f068aaf: drm/bridge: imx8mp-hdmi-pvi: Convert to platform remove callback returning void (2024-04-10 15:06:45 +0200) are available in the Git repository at: https://gitlab.freedesktop.org/drm/misc/kernel.git tags/drm-misc-next-2024-04-19 for you to fetch changes up to 069a6c0e94f99437652dbb7229a56233c7d39968: drm: panel: Add LG sw43408 panel driver (2024-04-19 04:27:48 +0300) drm-misc-next for v6.10-rc1: UAPI Changes: - Add SIZE_HINTS property for cursor planes. Cross-subsystem Changes: Core Changes: - Document the requirements and expectations of adding new driver-specific properties. - Assorted small fixes to ttm. - More Kconfig fixes. - Add struct drm_edid_product_id and helpers. - Use drm device based logging in more drm functions. - Fixes for drm-panic, and option to test it. - Assorted small fixes and updates to edid. - Add drm_crtc_vblank_crtc and use it in vkms, nouveau. Driver Changes: - Assorted small fixes and improvements to bridge/imx8mp-hdmi-tx, nouveau, ast, qaic, lima, vc4, bridge/anx7625, mipi-dsi. - Add drm panic to simpledrm, mgag200, imx, ast. - Use dev_err_probe in bridge/panel drivers. - Add Innolux G121X1-L03, LG sw43408 panels. - Use struct drm_edid in i915 bios parsing. Aleksandr Mishin (1): drm: vc4: Fix possible null pointer dereference Arnd Bergmann (2): accel/qaic: mark debugfs stub functions as static inline drm: fix DRM_DISPLAY_DP_HELPER dependencies, part 2 Baruch Siach (1): doc: dma-buf: fix grammar typo Daniel Vetter (1): drm/panic: Add drm panic locking Dmitry Baryshkov (2): drm/mipi-dsi: use correct return type for the DSC functions drm/mipi-dsi: add mipi_dsi_compression_mode_ext() Erico Nunes (5): drm/lima: add mask irq callback to gp and pp drm/lima: include pp bcast irq in timeout handler check drm/lima: mask irqs in timeout path before hard reset drm/lima: fix shared irq handling on driver remove drm/lima: fix void pointer to enum lima_gpu_id cast warning Hsin-Te Yuan (1): drm/bridge: anx7625: Update audio status while detecting Huai-Yuan Liu (1): drm/arm/malidp: fix a possible null pointer dereference Jani Nikula (18): drm/edid: add drm_edid_get_product_id() drm/edid: add drm_edid_print_product_id() drm/i915/bios: switch to struct drm_edid and struct drm_edid_product_id drm/i915/bios: return drm_edid_product_id from get_lvds_pnp_id() drm/probe-helper: switch to drm device based logging drm/modes: switch to drm device based error logging drm/sysfs: switch to drm device based logging drm/client: switch to drm device based logging, and more drm/crtc: switch to drm device based logging drm/crtc-helper: switch to drm device based logging and warns drm: prefer DRM_MODE_FMT/ARG over drm_mode_debug_printmodeline() drm/displayid: move drm_displayid.h to drm_displayd_internal.h drm/edid: move all internal declarations to drm_crtc_internal.h drm/edid: group struct drm_edid based declarations together drm/edid: rename drm_find_edid_extension() to drm_edid_find_extension() drm/edid: avoid drm_edid_find_extension() internally drm/edid: make drm_edid_are_equal() static drm/edid: make drm_edid_are_equal() more convenient for its single user Jeffrey Hugo (1): accel/qaic: Add Sahara implementation for firmware loading Jesse Zhang (1): drm/ttm: remove unused paramter Jocelyn Falempe (9): drm/panic: Add a drm panic handler drm/panic: Add support for color format conversion drm/panic: Add debugfs entry to test without triggering panic. drm/fb_dma: Add generic get_scanout_buffer() for drm_panic drm/simpledrm: Add drm_panic support drm/mgag200: Add drm_panic support drm/imx: Add
[PULL] drm-misc-next
Hi Dave, Sima, Still low amount of patches this week! Cheers, ~Maarten drm-misc-next-2024-04-10: drm-misc-next for v6.10: Cross-subsystem Changes: - Add Tomi as Xilinx maintainer. - Add sound bindings to DT. Core Changes: - Make DP helper depend on KMS helper. Driver Changes: - Assorted small fixes to bridge/dw-hdmi, bridge/cdns-mhdp8456, xlnx, omap, tilcdc, bridge/imx8mp-hdmi-pvi. - Add debugfs entries to qaic. - Add conservative fallback to panel eDP. The following changes since commit d1ef8fc18be6adbbffdee06fbb5b33699e2852be: drm: fix DRM_DISPLAY_DP_HELPER dependencies (2024-04-04 16:20:57 +0200) are available in the Git repository at: https://gitlab.freedesktop.org/drm/misc/kernel.git tags/drm-misc-next-2024-04-10 for you to fetch changes up to 29b39672bc1d651010f7b61e106d51998f068aaf: drm/bridge: imx8mp-hdmi-pvi: Convert to platform remove callback returning void (2024-04-10 15:06:45 +0200) drm-misc-next for v6.10: Cross-subsystem Changes: - Add Tomi as Xilinx maintainer. - Add sound bindings to DT. Core Changes: - Make DP helper depend on KMS helper. Driver Changes: - Assorted small fixes to bridge/dw-hdmi, bridge/cdns-mhdp8456, xlnx, omap, tilcdc, bridge/imx8mp-hdmi-pvi. - Add debugfs entries to qaic. - Add conservative fallback to panel eDP. Aleksandr Mishin (1): drm: bridge: cdns-mhdp8546: Fix possible null pointer dereference Chen-Yu Tsai (1): dt-bindings: display: bridge: it6505: Add #sound-dai-cells Dan Carpenter (1): drm: xlnx: db: fix a memory leak in probe Douglas Anderson (3): drm/panel-edp: Abstract out function to set conservative timings drm/panel-edp: If we fail to powerup/get EDID, use conservative timings drm-panel: If drm_panel_dp_aux_backlight() fails, don't fail panel probe Jani Nikula (1): drm: remove unused header gma_drm.h Jeffrey Hugo (3): accel/qaic: Add bootlog debugfs accel/qaic: Add fifo size debugfs accel/qaic: Add fifo queued debugfs Krzysztof Kozlowski (1): drm/omap: dmm_tiler: drop driver owner assignment Maxime Ripard (2): drm/display: Select DRM_KMS_HELPER for DP helpers drm/bridge: dw-hdmi: Make DRM_DW_HDMI selectable Tomi Valkeinen (1): MAINTAINERS: Add myself as maintainer for Xilinx DRM drivers Uwe Kleine-König (1): drm/bridge: imx8mp-hdmi-pvi: Convert to platform remove callback returning void Wolfram Sang (1): drm: tilcdc: don't use devm_pinctrl_get_select_default() in probe .../bindings/display/bridge/ite,it6505.yaml| 8 +- MAINTAINERS| 1 + drivers/accel/qaic/Makefile| 2 + drivers/accel/qaic/qaic.h | 9 + drivers/accel/qaic/qaic_data.c | 9 + drivers/accel/qaic/qaic_debugfs.c | 338 + drivers/accel/qaic/qaic_debugfs.h | 20 ++ drivers/accel/qaic/qaic_drv.c | 16 +- .../gpu/drm/bridge/cadence/cdns-mhdp8546-core.c| 3 + drivers/gpu/drm/bridge/imx/imx8mp-hdmi-pvi.c | 6 +- drivers/gpu/drm/bridge/synopsys/Kconfig| 2 +- drivers/gpu/drm/display/Kconfig| 1 + drivers/gpu/drm/omapdrm/omap_dmm_tiler.c | 1 - drivers/gpu/drm/panel/panel-edp.c | 60 ++-- drivers/gpu/drm/panel/panel-samsung-atna33xc20.c | 9 +- drivers/gpu/drm/tilcdc/tilcdc_panel.c | 6 - drivers/gpu/drm/xlnx/zynqmp_dp.c | 2 +- include/drm/gma_drm.h | 13 - 18 files changed, 450 insertions(+), 56 deletions(-) create mode 100644 drivers/accel/qaic/qaic_debugfs.c create mode 100644 drivers/accel/qaic/qaic_debugfs.h delete mode 100644 include/drm/gma_drm.h
Re: [rebase 1/3] drm: Add drm_vblank_work_flush_all().
Hey, On 2024-04-05 15:36, Lucas De Marchi wrote: what does "rebase" instead of "PATCH" is supposed to mean here? And then we have a "PATCH v2" as reply to this one. Shouldn't this go to dri-devel (too)? Lucas De Marchi I was rebasing so no changes were originally made. Afterwards I found out why the patch series failed, and sent a v2 patch for that specifically. I think this should go to dri-devel, forgot this patch required it. :) Can send a full v2 patch series in the beginning of next week. It looks like I still missed a uaf even with this fix. :( Cheers, ~Maarten On Thu, Apr 04, 2024 at 12:48:11PM +0200, Maarten Lankhorst wrote: From: Maarten Lankhorst In some cases we want to flush all vblank work, right before vblank_off for example. Add a simple function to make this possible. Signed-off-by: Maarten Lankhorst --- drivers/gpu/drm/drm_vblank_work.c | 22 ++ include/drm/drm_vblank_work.h | 2 ++ 2 files changed, 24 insertions(+) diff --git a/drivers/gpu/drm/drm_vblank_work.c b/drivers/gpu/drm/drm_vblank_work.c index 43cd5c0f4f6f..ff86f2b2e052 100644 --- a/drivers/gpu/drm/drm_vblank_work.c +++ b/drivers/gpu/drm/drm_vblank_work.c @@ -232,6 +232,28 @@ void drm_vblank_work_flush(struct drm_vblank_work *work) } EXPORT_SYMBOL(drm_vblank_work_flush); +/** + * drm_vblank_work_flush_all - flush all currently pending vblank work on crtc. + * @crtc: crtc for which vblank work to flush + * + * Wait until all currently queued vblank work on @crtc + * has finished executing once. + */ +void drm_vblank_work_flush_all(struct drm_crtc *crtc) +{ + struct drm_device *dev = crtc->dev; + struct drm_vblank_crtc *vblank = >vblank[drm_crtc_index(crtc)]; + + spin_lock_irq(>event_lock); + wait_event_lock_irq(vblank->work_wait_queue, + waitqueue_active(>work_wait_queue), + dev->event_lock); + spin_unlock_irq(>event_lock); + + kthread_flush_worker(vblank->worker); +} +EXPORT_SYMBOL(drm_vblank_work_flush_all); + /** * drm_vblank_work_init - initialize a vblank work item * @work: vblank work item diff --git a/include/drm/drm_vblank_work.h b/include/drm/drm_vblank_work.h index eb41d0810c4f..e04d436b7297 100644 --- a/include/drm/drm_vblank_work.h +++ b/include/drm/drm_vblank_work.h @@ -17,6 +17,7 @@ struct drm_crtc; * drm_vblank_work_init() * drm_vblank_work_cancel_sync() * drm_vblank_work_flush() + * drm_vblank_work_flush_all() */ struct drm_vblank_work { /** @@ -67,5 +68,6 @@ void drm_vblank_work_init(struct drm_vblank_work *work, struct drm_crtc *crtc, void (*func)(struct kthread_work *work)); bool drm_vblank_work_cancel_sync(struct drm_vblank_work *work); void drm_vblank_work_flush(struct drm_vblank_work *work); +void drm_vblank_work_flush_all(struct drm_crtc *crtc); #endif /* !_DRM_VBLANK_WORK_H_ */ -- 2.43.0
[PULL] drm-misc-next
Hi Dave, Sima, Everyone seems to be out on vacation, so the pull request is pretty empty. Cheers, ~Maarten drm-misc-next-2024-04-05: drm-misc-next for v6.10: Core Changes: - Fix DRM_DISPLAY_DP_HELPER dependencies. Driver Changes: - i2c and polling fixes to ast. - Small fixes to panthor. - Allow IRQ to share GPIO pins in bridge/adv7511. The following changes since commit 39cd87c4eb2b893354f3b850f916353f2658ae6f: Linux 6.9-rc2 (2024-03-31 14:32:39 -0700) are available in the Git repository at: https://gitlab.freedesktop.org/drm/misc/kernel.git tags/drm-misc-next-2024-04-05 for you to fetch changes up to d1ef8fc18be6adbbffdee06fbb5b33699e2852be: drm: fix DRM_DISPLAY_DP_HELPER dependencies (2024-04-04 16:20:57 +0200) drm-misc-next for v6.10: Core Changes: - Fix DRM_DISPLAY_DP_HELPER dependencies. Driver Changes: - i2c and polling fixes to ast. - Small fixes to panthor. - Allow IRQ to share GPIO pins in bridge/adv7511. Adam Ford (1): drm/bridge: adv7511: Allow IRQ to share GPIO pins Adrián Larumbe (1): ABI: sysfs-driver-panfrost-profiling: fix indentation problem Arnd Bergmann (1): drm: fix DRM_DISPLAY_DP_HELPER dependencies Boris Brezillon (3): drm/panthor: Fix IO-page mmap() for 32-bit userspace on 64-bit kernel drm/panthor: Fix ordering in _irq_suspend() drm/panthor: Drop the dev_enter/exit() sections in _irq_suspend/resume() Chris Morgan (3): dt-bindings: vendor-prefix: Add prefix for GameForce dt-bindings: display: Add GameForce Chi Panel drm/panel: st7703: Add GameForce Chi Panel Support Christian Hewitt (1): drm/meson: vclk: fix calculation of 59.94 fractional rates Dan Carpenter (3): drm/panthor: Fix a couple -ENOMEM error codes drm/panthor: Fix error code in panthor_gpu_init() drm/panthor: Fix off by one in panthor_fw_get_cs_iface() Harshit Mogalapalli (2): drm/panthor: Fix NULL vs IS_ERR() bug in panthor_probe() drm/panthor: Don't return NULL from panthor_vm_get_heap_pool() Ian Forbes (1): drm/vmwgfx: Remove unused code Liviu Dudau (2): drm/panthor: Cleanup unused variable 'cookie' drm/panthor: Fix some kerneldoc warnings Nathan Chancellor (1): drm/panthor: Fix clang -Wunused-but-set-variable in tick_ctx_apply() Thomas Zimmermann (14): Merge drm/drm-next into drm-misc-next drm/ast: Include where necessary drm/ast: Fail probing if DDC channel could not be initialized drm/ast: Remove struct ast_{vga,sil165}_connector drm/ast: Allocate instance of struct ast_i2c_chan with managed helpers drm/ast: Move DDC code to ast_ddc.{c,h} drm/ast: Rename struct ast_i2c_chan to struct ast_ddc drm/ast: Pass AST device to ast_ddc_create() drm/ast: Store AST device in struct ast_ddc drm/ast: Rename struct i2c_algo_bit_data callbacks and their parameters drm/ast: Acquire I/O-register lock in DDC code drm/ast: Use drm_connector_helper_get_modes() drm/ast: Implement polling for VGA and SIL164 connectors drm/ast: Automatically clean up poll helper .../ABI/testing/sysfs-driver-panfrost-profiling| 10 + .../bindings/display/bridge/lvds-codec.yaml|1 + .../bindings/display/panel/ilitek,ili9881c.yaml|1 + .../bindings/display/panel/novatek,nt35950.yaml|3 +- .../bindings/display/panel/novatek,nt36523.yaml| 25 +- .../bindings/display/panel/panel-common-dual.yaml | 47 + .../bindings/display/panel/panel-simple-dsi.yaml |2 + .../bindings/display/panel/panel-simple.yaml |4 + .../display/panel/rocktech,jh057n00900.yaml|2 + .../bindings/display/panel/sony,td4353-jdi.yaml|2 + .../bindings/gpu/arm,mali-valhall-csf.yaml | 147 + .../devicetree/bindings/vendor-prefixes.yaml |4 + Documentation/gpu/driver-uapi.rst |5 + Documentation/gpu/panfrost.rst |9 + MAINTAINERS| 183 +- arch/m68k/include/asm/pgtable.h|2 + arch/parisc/configs/generic-32bit_defconfig|2 +- drivers/gpu/drm/Kconfig| 23 +- drivers/gpu/drm/Makefile | 29 + drivers/gpu/drm/amd/amdgpu/Kconfig | 12 +- drivers/gpu/drm/amd/amdgpu/amdgpu_object.c |6 + drivers/gpu/drm/ast/Makefile | 10 +- drivers/gpu/drm/ast/{ast_i2c.c => ast_ddc.c} | 120 +- drivers/gpu/drm/ast/ast_ddc.h | 20 + drivers/gpu/drm/ast/ast_drv.c |1 + drivers/gpu/drm/ast/ast_drv.h | 39 +- drivers/gpu/drm/ast/ast_main.c |1 + drivers/gpu/drm/ast/ast_mode.c | 147 +-
[PULL] drm-misc-next
Hi Dave, Sima, Happy easter!! Cheers, ~Maarten drm-misc-next-2024-03-28: drm-misc-next for v6.10-rc1: The deal of a lifetime! You get ALL of the previous drm-misc-next-2024-03-21-1 tag!! But WAIT, there's MORE! Cross-subsystem Changes: - Assorted DT binding updates. Core Changes: - Clarify how optional wait_hpd_asserted is. - Shuffle Kconfig names around. Driver Changes: - Assorted build fixes for panthor, imagination, - Add AUO B120XAN01.0 panels. - Assorted small fixes to panthor, panfrost. The following changes since commit b9511c6d277c31b13d4f3128eba46f4e0733d734: Merge tag 'drm-msm-next-2024-03-07' of https://gitlab.freedesktop.org/drm/msm into drm-next (2024-03-08 12:45:21 +1000) are available in the Git repository at: https://gitlab.freedesktop.org/drm/misc/kernel.git tags/drm-misc-next-2024-03-28 for you to fetch changes up to 4b2d588d8a7520b414290312c9b40bca48b15e39: drm: DRM_WERROR should depend on DRM (2024-03-28 12:36:04 +0200) drm-misc-next for v6.10-rc1: The deal of a lifetime! You get ALL of the previous drm-misc-next-2024-03-21-1 tag!! But WAIT, there's MORE! Cross-subsystem Changes: - Assorted DT binding updates. Core Changes: - Clarify how optional wait_hpd_asserted is. - Shuffle Kconfig names around. Driver Changes: - Assorted build fixes for panthor, imagination, - Add AUO B120XAN01.0 panels. - Assorted small fixes to panthor, panfrost. Adrián Larumbe (2): drm/panfrost: Replace fdinfo's profiling debugfs knob with sysfs drm/panfrost: Only display fdinfo's engine and cycle tags when profiling is on Andrew Halaney (1): drm/tidss: Use dev_err_probe() over dev_dbg() when failing to probe the port Andy Shevchenko (1): drm/gma500: Remove unused intel-mid.h Arnd Bergmann (1): drm/imagination: avoid -Woverflow warning Boris Brezillon (18): drm/panthor: Add uAPI drm/panthor: Add GPU register definitions drm/panthor: Add the device logical block drm/panthor: Add the GPU logical block drm/panthor: Add GEM logical block drm/panthor: Add the devfreq logical block drm/panthor: Add the MMU/VM logical block drm/panthor: Add the FW logical block drm/panthor: Add the heap logical block drm/panthor: Add the scheduler logical block drm/panthor: Add the driver frontend block drm/panthor: Allow driver compilation drm/panthor: Add an entry to MAINTAINERS drm/panthor: Fix panthor_devfreq kerneldoc drm/panthor: Explicitly include mm.h for the {virt, __phys)_to_pfn() defs drm/panthor: Fix undefined panthor_device_suspend/resume symbol issue drm/panthor: Fix the CONFIG_PM=n case drm/panthor: Fix wrong kernel-doc format in the uAPI header Christian König (3): drm/ttm: improve idle/busy handling v5 drm/amdgpu: use GTT only as fallback for VRAM|GTT drm/ttm: warn when resv objs are mixed in a bulk_move Colin Ian King (1): drm/panthor: Fix spelling mistake "readyness" -> "readiness" Dmitry Baryshkov (1): dt-bindings: display/lvds-codec: add ti,sn65lvds94 Douglas Anderson (2): drm/panel: atna33xc20: Fix unbalanced regulator in the case HPD doesn't assert drm/dp: Clarify that wait_hpd_asserted() is not optional for panels Geert Uytterhoeven (2): m68k: pgtable: Add missing #include drm: DRM_WERROR should depend on DRM Heiko Stuebner (2): drm/panel: ltk050h3146w: add MIPI_DSI_MODE_VIDEO to LTK050H3148W flags drm/panel: ltk050h3146w: drop duplicate commands from LTK050H3148W init Hsin-Yi Wang (5): drm_edid: Add a function to get EDID base block drm/edid: Add a function to match EDID with identity drm/edid: Match edid quirks with identity drm/panel-edp: Match edp_panels with panel identity drm/panel-edp: Fix AUO 0x405c panel naming and add a variant Jagan Teki (2): drm/bridge: Fix improper bridge init order with pre_enable_prev_first drm/bridge: Document bridge init order with pre_enable_prev_first Jani Nikula (29): drm: enable (most) W=1 warnings by default across the subsystem drm: Add CONFIG_DRM_WERROR drm/crtc: make drm_crtc_internal.h self-contained drm: add missing header guards to drm_internal.h drm/kunit: fix drm_kunit_helpers.h kernel-doc drm/amdgpu: make amd_asic_type.h self-contained drm: bridge: samsung-dsim: make samsung-dsim.h self-contained drm/dp_mst: fix drm_dp_mst_helper.h kernel-doc drm/crc: make drm_debugfs_crc.h self-contained and fix kernel-doc drm: fix drm_format_helper.h kernel-doc warnings drm/lease: make drm_lease.h self-contained drm: fix drm_gem_vram_helper.h kernel-doc drm/of: make drm_of.h self-contained drm/suballoc: fix drm_suballoc.h kernel-doc drm: add missing header guards to
[PULL] drm-misc-next
drm-misc-next-2024-03-21-1: drm-misc-next for v6.10: UAPI Changes: - Move some nouveau magic constants to uapi. Cross-subsystem Changes: - Move drm-misc to gitlab and freedesktop hosting. - Add entries for panfrost. Core Changes: - Improve placement for TTM bo's in idle/busy handling. - Improve drm/bridge init ordering. - Add CONFIG_DRM_WERROR, and use W=1 for drm. - Assorted documentation updates. - Make more (drm and driver) headers self-contained and add header guards. - Grab reservation lock in pin/unpin callbacks. - Fix reservation lock handling for vmap. - Add edp and edid panel matching, use it to fix a nearly identical panel. Driver Changes: - Add drm/panthor driver and assorted fixes. - Assorted small fixes to xlnx, panel-edp, tidss, ci, nouveau, panel and bridge drivers. - Add Samsung s6e3fa7, BOE NT116WHM-N44, CMN N116BCA-EA1, CrystalClear CMT430B19N00, Startek KD050HDFIA020-C020A, powertip PH128800T006-ZHC01 panels. - Fix console for omapdrm. The following changes since commit b9511c6d277c31b13d4f3128eba46f4e0733d734: Merge tag 'drm-msm-next-2024-03-07' of https://gitlab.freedesktop.org/drm/msm into drm-next (2024-03-08 12:45:21 +1000) are available in the Git repository at: https://gitlab.freedesktop.org/drm/misc/kernel.git tags/drm-misc-next-2024-03-21-1 for you to fetch changes up to 5e842d55bad7794823a50f24fd645b58f2ef93ab: drm/panel: atna33xc20: Fix unbalanced regulator in the case HPD doesn't assert (2024-03-20 08:26:18 -0700) drm-misc-next for v6.10: UAPI Changes: - Move some nouveau magic constants to uapi. Cross-subsystem Changes: - Move drm-misc to gitlab and freedesktop hosting. - Add entries for panfrost. Core Changes: - Improve placement for TTM bo's in idle/busy handling. - Improve drm/bridge init ordering. - Add CONFIG_DRM_WERROR, and use W=1 for drm. - Assorted documentation updates. - Make more (drm and driver) headers self-contained and add header guards. - Grab reservation lock in pin/unpin callbacks. - Fix reservation lock handling for vmap. - Add edp and edid panel matching, use it to fix a nearly identical panel. Driver Changes: - Add drm/panthor driver and assorted fixes. - Assorted small fixes to xlnx, panel-edp, tidss, ci, nouveau, panel and bridge drivers. - Add Samsung s6e3fa7, BOE NT116WHM-N44, CMN N116BCA-EA1, CrystalClear CMT430B19N00, Startek KD050HDFIA020-C020A, powertip PH128800T006-ZHC01 panels. - Fix console for omapdrm. Adrián Larumbe (1): drm/panfrost: Replace fdinfo's profiling debugfs knob with sysfs Andrew Halaney (1): drm/tidss: Use dev_err_probe() over dev_dbg() when failing to probe the port Andy Shevchenko (1): drm/gma500: Remove unused intel-mid.h Boris Brezillon (16): drm/panthor: Add uAPI drm/panthor: Add GPU register definitions drm/panthor: Add the device logical block drm/panthor: Add the GPU logical block drm/panthor: Add GEM logical block drm/panthor: Add the devfreq logical block drm/panthor: Add the MMU/VM logical block drm/panthor: Add the FW logical block drm/panthor: Add the heap logical block drm/panthor: Add the scheduler logical block drm/panthor: Add the driver frontend block drm/panthor: Allow driver compilation drm/panthor: Add an entry to MAINTAINERS drm/panthor: Fix panthor_devfreq kerneldoc drm/panthor: Explicitly include mm.h for the {virt, __phys)_to_pfn() defs drm/panthor: Fix undefined panthor_device_suspend/resume symbol issue Christian König (3): drm/ttm: improve idle/busy handling v5 drm/amdgpu: use GTT only as fallback for VRAM|GTT drm/ttm: warn when resv objs are mixed in a bulk_move Dmitry Baryshkov (1): dt-bindings: display/lvds-codec: add ti,sn65lvds94 Douglas Anderson (1): drm/panel: atna33xc20: Fix unbalanced regulator in the case HPD doesn't assert Geert Uytterhoeven (1): m68k: pgtable: Add missing #include Hsin-Yi Wang (5): drm_edid: Add a function to get EDID base block drm/edid: Add a function to match EDID with identity drm/edid: Match edid quirks with identity drm/panel-edp: Match edp_panels with panel identity drm/panel-edp: Fix AUO 0x405c panel naming and add a variant Jagan Teki (2): drm/bridge: Fix improper bridge init order with pre_enable_prev_first drm/bridge: Document bridge init order with pre_enable_prev_first Jani Nikula (29): drm: enable (most) W=1 warnings by default across the subsystem drm: Add CONFIG_DRM_WERROR drm/crtc: make drm_crtc_internal.h self-contained drm: add missing header guards to drm_internal.h drm/kunit: fix drm_kunit_helpers.h kernel-doc drm/amdgpu: make amd_asic_type.h self-contained drm: bridge: samsung-dsim: make samsung-dsim.h self-contained
Re: [PATCH 6/6] drm/xe/stolen: ignore first page for FBC
On 2024-02-15 18:44, Matthew Auld wrote: Seems like we can potentially hit underruns if the CFB offset is within the first page of stolen. Just like i915 skip the first page. BSpec: 50214 Reported-by: Matt Roper Signed-off-by: Matthew Auld --- drivers/gpu/drm/xe/compat-i915-headers/i915_gem_stolen.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/xe/compat-i915-headers/i915_gem_stolen.h b/drivers/gpu/drm/xe/compat-i915-headers/i915_gem_stolen.h index bd233007c1b7..003474cfdf31 100644 --- a/drivers/gpu/drm/xe/compat-i915-headers/i915_gem_stolen.h +++ b/drivers/gpu/drm/xe/compat-i915-headers/i915_gem_stolen.h @@ -19,6 +19,9 @@ static inline int i915_gem_stolen_insert_node_in_range(struct xe_device *xe, int err; u32 flags = XE_BO_CREATE_PINNED_BIT | XE_BO_CREATE_STOLEN_BIT; + if (start < SZ_4K) + start = SZ_4K; + if (align) size = ALIGN(size, align); Should start also be aligned? If that's taken care of by other code, for both patches: Reviewed-by: Maarten Lankhorst
Re: [PATCH] drm/xe/display: Fix memleak in display initialization
On 2024-01-31 16:07, Jani Nikula wrote: On Wed, 31 Jan 2024, Lucas De Marchi wrote: +Jani On Fri, Jan 26, 2024 at 11:34:53PM +0800, wangxiaoming321 wrote: intel_power_domains_init has been called twice in xe_device_probe: xe_device_probe -> xe_display_init_nommio -> intel_power_domains_init(xe) xe_device_probe -> xe_display_init_noirq -> intel_display_driver_probe_noirq -> intel_power_domains_init(i915) ok, once upon a time intel_power_domains_init() was called by the driver initialization code and not initialized inside the display. I think. Now it's part of the display probe and we never updated the xe side. It needs remove one to avoid power_domains->power_wells double malloc. unreferenced object 0x88811150ee00 (size 512): comm "systemd-udevd", pid 506, jiffies 4294674198 (age 3605.560s) hex dump (first 32 bytes): 10 b4 9d a0 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 00 00 00 00 00 00 00 00 backtrace: [] __kmem_cache_alloc_node+0x1c1/0x2b0 [] __kmalloc+0x52/0x150 [] __set_power_wells+0xc3/0x360 [xe] [] xe_display_init_nommio+0x4c/0x70 [xe] [] xe_device_probe+0x3c/0x5a0 [xe] [] xe_pci_probe+0x33f/0x5a0 [xe] [] local_pci_probe+0x47/0xa0 [] pci_device_probe+0xc3/0x1f0 [] really_probe+0x1a2/0x410 [] __driver_probe_device+0x78/0x160 [] driver_probe_device+0x1e/0x90 [] __driver_attach+0xda/0x1d0 [] bus_for_each_dev+0x7c/0xd0 [] bus_add_driver+0x119/0x220 [] driver_register+0x60/0x120 [] 0xa05e50a0 This will need a Fixes trailer. This seems to be a suitable one: Fixes: 44e694958b95 ("drm/xe/display: Implement display support") Signed-off-by: wangxiaoming321 --- drivers/gpu/drm/xe/xe_display.c | 6 -- 1 file changed, 6 deletions(-) diff --git a/drivers/gpu/drm/xe/xe_display.c b/drivers/gpu/drm/xe/xe_display.c index 74391d9b11ae..e4db069f0db3 100644 --- a/drivers/gpu/drm/xe/xe_display.c +++ b/drivers/gpu/drm/xe/xe_display.c @@ -134,8 +134,6 @@ static void xe_display_fini_nommio(struct drm_device *dev, void *dummy) int xe_display_init_nommio(struct xe_device *xe) { - int err; - if (!xe->info.enable_display) return 0; @@ -145,10 +143,6 @@ int xe_display_init_nommio(struct xe_device *xe) /* This must be called before any calls to HAS_PCH_* */ intel_detect_pch(xe); - err = intel_power_domains_init(xe); - if (err) - return err; xe_display_init_nommio() has xe_display_fini_nommio() as its destructor counter part. Unfortunately display side looks wrong as it does: init: intel_display_driver_probe_noirq() -> intel_power_domains_init() destroy: i915_driver_late_release() -> intel_power_domains_cleanup() I think leaving intel_power_domains_cleanup() as is for now so it's called by xe works, but this needs to go through CI, which apparently this series didn't go. I re-triggered it. +Jani if he thinks this can be changed in another way or already have the complete solution. I don't. But it is and will be a recurring problem. i915 and xe core drivers should handle display init and cleanup the same way. But currently i915 goes on to call e.g. intel_power_domains_cleanup() directly from top level driver code. There are other examples. And we seem to have recently added *more*. See e.g. bd738d859e71 ("drm/i915: Prevent modesets during driver init/shutdown"). That commit seems terrible Should we instead not only enable any code that can cause modesets after it's safe to do so? Cheers, ~Maarten
[PULL] drm-misc-fixes
Hi Dave, Daniel, Happy new year! ~Maarten drm-misc-fixes-2024-01-03: drm-misc-fixes for v6.7 final: - 2 small qaic fixes. - Fixes for overflow in aux xfer. - Fix uninitialised gamma lut in gmag200. - Small compiler warning fix for backports of a ps8640 fix. The following changes since commit 6c9dbee84cd005bed5f9d07b3a2797ae6414b435: drm/panel: ltk050h3146w: Set burst mode for ltk050h3148w (2023-12-13 18:33:43 +0100) are available in the Git repository at: git://anongit.freedesktop.org/drm/drm-misc tags/drm-misc-fixes-2024-01-03 for you to fetch changes up to 11f9eb899ecc8c02b769cf8d2532ba12786a7af7: drm/mgag200: Fix gamma lut not initialized for G200ER, G200EV, G200SE (2023-12-20 13:26:57 +0100) drm-misc-fixes for v6.7 final: - 2 small qaic fixes. - Fixes for overflow in aux xfer. - Fix uninitialised gamma lut in gmag200. - Small compiler warning fix for backports of a ps8640 fix. Douglas Anderson (3): drm/bridge: parade-ps8640: Never store more than msg->size bytes in AUX xfer drm/bridge: ti-sn65dsi86: Never store more than msg->size bytes in AUX xfer drm/bridge: ps8640: Fix size mismatch warning w/ len Jeffrey Hugo (1): accel/qaic: Implement quirk for SOC_HW_VERSION Jocelyn Falempe (1): drm/mgag200: Fix gamma lut not initialized for G200ER, G200EV, G200SE Pranjal Ramajor Asha Kanojiya (1): accel/qaic: Fix GEM import path code drivers/accel/qaic/mhi_controller.c | 15 ++- drivers/accel/qaic/qaic_data.c | 6 ++ drivers/gpu/drm/bridge/parade-ps8640.c | 7 --- drivers/gpu/drm/bridge/ti-sn65dsi86.c| 4 +++- drivers/gpu/drm/mgag200/mgag200_drv.h| 5 + drivers/gpu/drm/mgag200/mgag200_g200er.c | 5 + drivers/gpu/drm/mgag200/mgag200_g200ev.c | 5 + drivers/gpu/drm/mgag200/mgag200_g200se.c | 5 + drivers/gpu/drm/mgag200/mgag200_mode.c | 10 +- 9 files changed, 48 insertions(+), 14 deletions(-)
[PULL] drm-misc-fixes
Hi Dave, Daniel, Small fixes all over the place, one regression fix for master capability. Cheers, ~Maarten drm-misc-fixes-2023-12-14: drm-misc-fixes for v6.7-rc6: - Fix regression for checking if FD is master capable. - Fix uninitialized variables in drm/crtc. - Fix ivpu w/a. - Refresh modes correctly when updating EDID. - Small panel fixes. The following changes since commit e0f04e41e8eedd4e5a1275f2318df7e1841855f2: drm/atomic-helpers: Invoke end_fb_access while owning plane state (2023-12-06 10:51:27 +0100) are available in the Git repository at: git://anongit.freedesktop.org/drm/drm-misc tags/drm-misc-fixes-2023-12-14 for you to fetch changes up to 6c9dbee84cd005bed5f9d07b3a2797ae6414b435: drm/panel: ltk050h3146w: Set burst mode for ltk050h3148w (2023-12-13 18:33:43 +0100) drm-misc-fixes for v6.7-rc6: - Fix regression for checking if FD is master capable. - Fix uninitialized variables in drm/crtc. - Fix ivpu w/a. - Refresh modes correctly when updating EDID. - Small panel fixes. Andrzej Kacprowski (1): accel/ivpu/37xx: Fix interrupt_clear_with_0 WA initialization David Heidelberg (1): dt-bindings: panel-simple-dsi: move LG 5" HD TFT LCD panel into DSI yaml Farouk Bouabid (1): drm/panel: ltk050h3146w: Set burst mode for ltk050h3148w Jani Nikula (2): drm/crtc: fix uninitialized variable use drm/edid: also call add modes in EDID connector update fallback Lingkai Dong (1): drm: Fix FD ownership check in drm_master_check_perm() Ziqi Zhao (1): drm/crtc: Fix uninit-value bug in drm_mode_setcrtc .../devicetree/bindings/display/panel/panel-simple-dsi.yaml | 2 ++ .../devicetree/bindings/display/panel/panel-simple.yaml | 2 -- drivers/accel/ivpu/ivpu_hw_37xx.c| 12 +--- drivers/gpu/drm/drm_auth.c | 2 +- drivers/gpu/drm/drm_crtc.c | 8 drivers/gpu/drm/drm_edid.c | 3 ++- drivers/gpu/drm/panel/panel-leadtek-ltk050h3146w.c | 2 +- 7 files changed, 19 insertions(+), 12 deletions(-)
[PULL] drm-misc-fixes
Hi Dave, Daniel, Pull request for v6.7-rc5. Cheers, ~Maarten drm-misc-fixes-2023-12-07: drm-misc-fixes for v6.7-rc5: - Document nouveau's GSP-RM. - Flush vmm harder on nouveau tu102. - Panfrost fix for imported dma-buf objects, and device frequency. - Kconfig Build fix for tc358768. - Call end_fb_access after atomic commit. The following changes since commit fb18fe0fdf22a2f4512a8b644bb5ea1473829cda: drm/panel: nt36523: fix return value check in nt36523_probe() (2023-11-29 16:54:23 +0100) are available in the Git repository at: git://anongit.freedesktop.org/drm/drm-misc tags/drm-misc-fixes-2023-12-07 for you to fetch changes up to e0f04e41e8eedd4e5a1275f2318df7e1841855f2: drm/atomic-helpers: Invoke end_fb_access while owning plane state (2023-12-06 10:51:27 +0100) drm-misc-fixes for v6.7-rc5: - Document nouveau's GSP-RM. - Flush vmm harder on nouveau tu102. - Panfrost fix for imported dma-buf objects, and device frequency. - Kconfig Build fix for tc358768. - Call end_fb_access after atomic commit. Adrián Larumbe (2): drm/panfrost: Consider dma-buf imported objects as resident drm/panfrost: Fix incorrect updating of current device frequency Arnd Bergmann (1): drm/bridge: tc358768: select CONFIG_VIDEOMODE_HELPERS Dave Airlie (1): nouveau/tu102: flush all pdbs on vmm flush Thomas Zimmermann (1): drm/atomic-helpers: Invoke end_fb_access while owning plane state Timur Tabi (1): nouveau/gsp: document some aspects of GSP-RM drivers/gpu/drm/bridge/Kconfig | 1 + drivers/gpu/drm/drm_atomic_helper.c| 78 +--- drivers/gpu/drm/i915/display/intel_display.c | 2 +- drivers/gpu/drm/nouveau/dispnv50/disp.c| 2 +- .../common/shared/msgq/inc/msgq/msgq_priv.h| 51 ++ drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c | 82 ++ drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmmtu102.c | 2 +- drivers/gpu/drm/panfrost/panfrost_devfreq.c| 17 - drivers/gpu/drm/panfrost/panfrost_gem.c| 2 +- include/drm/drm_atomic_helper.h| 2 + 10 files changed, 207 insertions(+), 32 deletions(-)
[PATCH] drm/i915/display: Use i915_gem_object_get_dma_address to get dma address
Works better for xe like that. obj is no longer const. Signed-off-by: Maarten Lankhorst --- drivers/gpu/drm/i915/display/intel_cursor.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_cursor.c b/drivers/gpu/drm/i915/display/intel_cursor.c index a515ae2831f8..926e2de00eb5 100644 --- a/drivers/gpu/drm/i915/display/intel_cursor.c +++ b/drivers/gpu/drm/i915/display/intel_cursor.c @@ -24,6 +24,8 @@ #include "intel_psr_regs.h" #include "skl_watermark.h" +#include "gem/i915_gem_object.h" + /* Cursor formats */ static const u32 intel_cursor_formats[] = { DRM_FORMAT_ARGB, @@ -34,11 +36,11 @@ static u32 intel_cursor_base(const struct intel_plane_state *plane_state) struct drm_i915_private *dev_priv = to_i915(plane_state->uapi.plane->dev); const struct drm_framebuffer *fb = plane_state->hw.fb; - const struct drm_i915_gem_object *obj = intel_fb_obj(fb); + struct drm_i915_gem_object *obj = intel_fb_obj(fb); u32 base; if (DISPLAY_INFO(dev_priv)->cursor_needs_physical) - base = sg_dma_address(obj->mm.pages->sgl); + base = i915_gem_object_get_dma_address(obj, 0); else base = intel_plane_ggtt_offset(plane_state); -- 2.40.1
[PULL] drm-misc-fixes
Hi Dave, Daniel, This pull request is a bit confusing, as it first adds the panel fixes and a driver/core change, then immediately revert it. Cheers, ~Maarten drm-misc-fixes-2023-11-29: Fixes for v6.7-rc4: - Revert panel fixes as they require exporting device_is_dependent. - Do not double add fences in dma_resv_add_fence. - Fix GPUVM license identifier. - Assorted nouveau fixes. - Fix error check for nt36523. The following changes since commit ab93edb2f94c3c0d5965be3815782472adbe3f52: nouveau/gsp: allocate enough space for all channel ids. (2023-11-21 22:28:01 +0100) are available in the Git repository at: git://anongit.freedesktop.org/drm/drm-misc tags/drm-misc-fixes-2023-11-29 for you to fetch changes up to fb18fe0fdf22a2f4512a8b644bb5ea1473829cda: drm/panel: nt36523: fix return value check in nt36523_probe() (2023-11-29 16:54:23 +0100) Fixes for v6.7-rc4: - Revert panel fixes as they require exporting device_is_dependent. - Do not double add fences in dma_resv_add_fence. - Fix GPUVM license identifier. - Assorted nouveau fixes. - Fix error check for nt36523. Christian König (1): dma-buf: fix check in dma_resv_add_fence Dan Carpenter (1): nouveau/gsp/r535: remove a stray unlock in r535_gsp_rpc_send() Dave Airlie (1): nouveau: find the smallest page allocation to cover a buffer alloc. Gustavo A. R. Silva (1): nouveau/gsp: replace zero-length array with flex-array member and use __counted_by Linus Walleij (3): Revert "drm/bridge: panel: Check device dependency before managing device link" Revert "driver core: Export device_is_dependent() to modules" Revert "drm/bridge: panel: Add a device link between drm device and panel device" Liu Ying (2): drm/bridge: panel: Check device dependency before managing device link driver core: Export device_is_dependent() to modules Thomas Hellström (1): drm/gpuvm: Fix deprecated license identifier Yang Yingliang (1): drm/panel: nt36523: fix return value check in nt36523_probe() xiazhengqiao (1): drm/panel: starry-2081101qfh032011-53g: Fine tune the panel power sequence drivers/dma-buf/dma-resv.c | 2 +- drivers/gpu/drm/bridge/panel.c | 17 - drivers/gpu/drm/drm_gpuvm.c | 2 +- .../nvrm/535.113.01/nvidia/generated/g_os_nvoc.h| 2 +- drivers/gpu/drm/nouveau/nouveau_bo.c| 5 +++-- drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c | 6 ++ drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c | 1 + drivers/gpu/drm/panel/panel-novatek-nt36523.c | 4 ++-- include/drm/drm_gpuvm.h | 2 +- include/linux/dma-fence.h | 15 +++ 10 files changed, 27 insertions(+), 29 deletions(-)
[PATCH 1/3] drm: Add drm_vblank_work_flush_all().
In some cases we want to flush all vblank work, right before vblank_off for example. Add a simple function to make this possible. Signed-off-by: Maarten Lankhorst --- drivers/gpu/drm/drm_vblank_work.c | 22 ++ include/drm/drm_vblank_work.h | 2 ++ 2 files changed, 24 insertions(+) diff --git a/drivers/gpu/drm/drm_vblank_work.c b/drivers/gpu/drm/drm_vblank_work.c index 43cd5c0f4f6f..ff86f2b2e052 100644 --- a/drivers/gpu/drm/drm_vblank_work.c +++ b/drivers/gpu/drm/drm_vblank_work.c @@ -232,6 +232,28 @@ void drm_vblank_work_flush(struct drm_vblank_work *work) } EXPORT_SYMBOL(drm_vblank_work_flush); +/** + * drm_vblank_work_flush_all - flush all currently pending vblank work on crtc. + * @crtc: crtc for which vblank work to flush + * + * Wait until all currently queued vblank work on @crtc + * has finished executing once. + */ +void drm_vblank_work_flush_all(struct drm_crtc *crtc) +{ + struct drm_device *dev = crtc->dev; + struct drm_vblank_crtc *vblank = >vblank[drm_crtc_index(crtc)]; + + spin_lock_irq(>event_lock); + wait_event_lock_irq(vblank->work_wait_queue, + waitqueue_active(>work_wait_queue), + dev->event_lock); + spin_unlock_irq(>event_lock); + + kthread_flush_worker(vblank->worker); +} +EXPORT_SYMBOL(drm_vblank_work_flush_all); + /** * drm_vblank_work_init - initialize a vblank work item * @work: vblank work item diff --git a/include/drm/drm_vblank_work.h b/include/drm/drm_vblank_work.h index eb41d0810c4f..e04d436b7297 100644 --- a/include/drm/drm_vblank_work.h +++ b/include/drm/drm_vblank_work.h @@ -17,6 +17,7 @@ struct drm_crtc; * drm_vblank_work_init() * drm_vblank_work_cancel_sync() * drm_vblank_work_flush() + * drm_vblank_work_flush_all() */ struct drm_vblank_work { /** @@ -67,5 +68,6 @@ void drm_vblank_work_init(struct drm_vblank_work *work, struct drm_crtc *crtc, void (*func)(struct kthread_work *work)); bool drm_vblank_work_cancel_sync(struct drm_vblank_work *work); void drm_vblank_work_flush(struct drm_vblank_work *work); +void drm_vblank_work_flush_all(struct drm_crtc *crtc); #endif /* !_DRM_VBLANK_WORK_H_ */ -- 2.40.1
[PATCH 2/3] drm/i915: Use vblank worker to unpin old legacy cursor fb safely
From: Ville Syrjälä The cursor hardware only does sync updates, and thus the hardware will be scanning out from the old fb until the next start of vblank. So in order to make the legacy cursor fastpath actually safe we should not unpin the old fb until we're sure the hardware has ceased accessing it. The simplest approach is to just use a vblank work here to do the delayed unpin. Not 100% sure it's a good idea to put this onto the same high priority vblank worker as eg. our timing critical gamma updates. But let's keep it simple for now, and it we later discover that this is causing problems we can think about adding a lower priority worker for such things. This patch is slightly reworked by Maarten Cc: Maarten Lankhorst Signed-off-by: Ville Syrjälä Signed-off-by: Maarten Lankhorst --- drivers/gpu/drm/i915/display/intel_cursor.c | 26 +-- drivers/gpu/drm/i915/display/intel_display.c | 3 +++ .../drm/i915/display/intel_display_types.h| 3 +++ 3 files changed, 30 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_cursor.c b/drivers/gpu/drm/i915/display/intel_cursor.c index a515ae2831f8..e38ea7311047 100644 --- a/drivers/gpu/drm/i915/display/intel_cursor.c +++ b/drivers/gpu/drm/i915/display/intel_cursor.c @@ -633,6 +633,17 @@ static bool intel_cursor_format_mod_supported(struct drm_plane *_plane, return format == DRM_FORMAT_ARGB; } +static void intel_cursor_unpin_work(struct kthread_work *base) +{ + struct drm_vblank_work *work = to_drm_vblank_work(base); + struct intel_plane_state *plane_state = + container_of(work, typeof(*plane_state), unpin_work); + struct intel_plane *plane = to_intel_plane(plane_state->uapi.plane); + + intel_plane_unpin_fb(plane_state); + intel_plane_destroy_state(>base, _state->uapi); +} + static int intel_legacy_cursor_update(struct drm_plane *_plane, struct drm_crtc *_crtc, @@ -760,14 +771,25 @@ intel_legacy_cursor_update(struct drm_plane *_plane, local_irq_enable(); - intel_plane_unpin_fb(old_plane_state); + if (old_plane_state->ggtt_vma != new_plane_state->ggtt_vma) { + drm_vblank_work_init(_plane_state->unpin_work, >base, +intel_cursor_unpin_work); + + drm_vblank_work_schedule(_plane_state->unpin_work, + drm_crtc_accurate_vblank_count(>base) + 1, +false); + + old_plane_state = NULL; + } else { + intel_plane_unpin_fb(old_plane_state); + } out_free: if (new_crtc_state) intel_crtc_destroy_state(>base, _crtc_state->uapi); if (ret) intel_plane_destroy_state(>base, _plane_state->uapi); - else + else if (old_plane_state) intel_plane_destroy_state(>base, _plane_state->uapi); return ret; diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c index 5cf162628b95..930fb471a870 100644 --- a/drivers/gpu/drm/i915/display/intel_display.c +++ b/drivers/gpu/drm/i915/display/intel_display.c @@ -64,6 +64,7 @@ #include "intel_crt.h" #include "intel_crtc.h" #include "intel_crtc_state_dump.h" +#include "intel_cursor.h" #include "intel_ddi.h" #include "intel_de.h" #include "intel_display_driver.h" @@ -6752,6 +6753,8 @@ static void intel_commit_modeset_disables(struct intel_atomic_state *state) continue; intel_crtc_disable_planes(state, crtc); + + drm_vblank_work_flush_all(>base); } /* Only disable port sync and MST slaves */ diff --git a/drivers/gpu/drm/i915/display/intel_display_types.h b/drivers/gpu/drm/i915/display/intel_display_types.h index b3e942f2eeb0..22ec3b42ceca 100644 --- a/drivers/gpu/drm/i915/display/intel_display_types.h +++ b/drivers/gpu/drm/i915/display/intel_display_types.h @@ -715,6 +715,9 @@ struct intel_plane_state { struct intel_fb_view view; + /* for legacy cursor fb unpin */ + struct drm_vblank_work unpin_work; + /* Plane pxp decryption state */ bool decrypt; -- 2.40.1
[PATCH 3/3] drm/i915: Use the same vblank worker for atomic unpin
In case of legacy cursor update, the cursor VMA needs to be unpinned only after vblank. This exceeds the lifetime of the whole atomic commit. Any trick I attempted to keep the atomic commit alive didn't work, as drm_atomic_helper_setup_commit() force throttles on any old commit that wasn't cleaned up. The only option remaining is to remove the plane from the atomic commit, and use the same path as the legacy cursor update to clean the state after vblank. Signed-off-by: Maarten Lankhorst --- .../gpu/drm/i915/display/intel_atomic_plane.c | 28 ++- .../gpu/drm/i915/display/intel_atomic_plane.h | 2 ++ drivers/gpu/drm/i915/display/intel_crtc.c | 28 +++ drivers/gpu/drm/i915/display/intel_cursor.c | 2 +- drivers/gpu/drm/i915/display/intel_cursor.h | 3 ++ 5 files changed, 61 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_atomic_plane.c b/drivers/gpu/drm/i915/display/intel_atomic_plane.c index 06c2455bdd78..cb4153ca1867 100644 --- a/drivers/gpu/drm/i915/display/intel_atomic_plane.c +++ b/drivers/gpu/drm/i915/display/intel_atomic_plane.c @@ -42,6 +42,7 @@ #include "i915_reg.h" #include "intel_atomic_plane.h" #include "intel_cdclk.h" +#include "intel_cursor.h" #include "intel_display_rps.h" #include "intel_display_trace.h" #include "intel_display_types.h" @@ -1163,7 +1164,21 @@ intel_cleanup_plane_fb(struct drm_plane *plane, intel_display_rps_mark_interactive(dev_priv, state, false); - /* Should only be called after a successful intel_prepare_plane_fb()! */ + /* +* This branch can only ever be called after plane update is succesful, +* the error path will not cause unpin_work to be set. +*/ + if (old_plane_state->unpin_work.vblank) { + int i = drm_plane_index(old_plane_state->uapi.plane); + + /* +* Remove plane from atomic commit, +* free is done from vblank worker +*/ + memset(>base.planes[i], 0, sizeof(*state->base.planes)); + return; + } + intel_plane_unpin_fb(old_plane_state); } @@ -1176,3 +1191,14 @@ void intel_plane_helper_add(struct intel_plane *plane) { drm_plane_helper_add(>base, _plane_helper_funcs); } + +void intel_plane_init_cursor_vblank_work(struct intel_plane_state *old_plane_state, +struct intel_plane_state *new_plane_state) +{ + if (!old_plane_state->ggtt_vma || + old_plane_state->ggtt_vma == new_plane_state->ggtt_vma) + return; + + drm_vblank_work_init(_plane_state->unpin_work, old_plane_state->uapi.crtc, +intel_cursor_unpin_work); +} diff --git a/drivers/gpu/drm/i915/display/intel_atomic_plane.h b/drivers/gpu/drm/i915/display/intel_atomic_plane.h index 191dad0efc8e..5a897cf6fa02 100644 --- a/drivers/gpu/drm/i915/display/intel_atomic_plane.h +++ b/drivers/gpu/drm/i915/display/intel_atomic_plane.h @@ -66,5 +66,7 @@ int intel_plane_check_src_coordinates(struct intel_plane_state *plane_state); void intel_plane_set_invisible(struct intel_crtc_state *crtc_state, struct intel_plane_state *plane_state); void intel_plane_helper_add(struct intel_plane *plane); +void intel_plane_init_cursor_vblank_work(struct intel_plane_state *old_plane_state, +struct intel_plane_state *new_plane_state); #endif /* __INTEL_ATOMIC_PLANE_H__ */ diff --git a/drivers/gpu/drm/i915/display/intel_crtc.c b/drivers/gpu/drm/i915/display/intel_crtc.c index 1fd068e6e26c..755c40fd0ac1 100644 --- a/drivers/gpu/drm/i915/display/intel_crtc.c +++ b/drivers/gpu/drm/i915/display/intel_crtc.c @@ -559,6 +559,19 @@ void intel_pipe_update_start(struct intel_atomic_state *state, if (intel_crtc_needs_vblank_work(new_crtc_state)) intel_crtc_vblank_work_init(new_crtc_state); + if (state->base.legacy_cursor_update) { + struct intel_plane *plane; + struct intel_plane_state *old_plane_state, *new_plane_state; + int i; + + for_each_oldnew_intel_plane_in_state(state, plane, old_plane_state, +new_plane_state, i) { + if (old_plane_state->uapi.crtc == >base) + intel_plane_init_cursor_vblank_work(old_plane_state, + new_plane_state); + } + } + intel_crtc_vblank_evade_scanlines(state, crtc, , , _start); if (min <= 0 || max <= 0) goto irq_disable; @@ -721,6 +734,21 @@ void intel_pipe_update_end(struct intel_atomic_state *state, new_crtc_state->ua
[PULL] drm-misc-fixes
Hi Dave, Daniel, Lots of small fixes for various drivers. Cheers, ~Maarten drm-misc-fixes-2023-11-23: Fixes for v6.7-rc3: - Panel fixes for innolux and auo,b101uan08.3 panel. - Fix ivpu MMIO reset. - AST fix on connetor disconnection. - nouveau gsp fix. - rockchip color fix. - Fix Himax83102-j02 timings. The following changes since commit ae1aadb1eb8d3cbc52e42bee71d67bd4a71f9f07: nouveau: don't fail driver load if no display hw present. (2023-11-15 18:23:31 +0100) are available in the Git repository at: git://anongit.freedesktop.org/drm/drm-misc tags/drm-misc-fixes-2023-11-23 for you to fetch changes up to ab93edb2f94c3c0d5965be3815782472adbe3f52: nouveau/gsp: allocate enough space for all channel ids. (2023-11-21 22:28:01 +0100) Fixes for v6.7-rc3: - Panel fixes for innolux and auo,b101uan08.3 panel. - Fix ivpu MMIO reset. - AST fix on connetor disconnection. - nouveau gsp fix. - rockchip color fix. - Fix Himax83102-j02 timings. Cong Yang (1): drm/panel: boe-tv101wum-nl6: Fine tune Himax83102-j02 panel HFP and HBP Dave Airlie (1): nouveau/gsp: allocate enough space for all channel ids. Jacek Lawrynowicz (1): accel/ivpu/37xx: Fix hangs related to MMIO reset Jonas Karlman (1): drm/rockchip: vop: Fix color for RGB888/BGR888 format on VOP full Marek Vasut (2): drm/panel: simple: Fix Innolux G101ICE-L01 bus flags drm/panel: simple: Fix Innolux G101ICE-L01 timings Thomas Zimmermann (1): drm/ast: Disconnect BMC if physical connector is connected Xuxin Xiong (1): drm/panel: auo,b101uan08.3: Fine tune the panel power sequence drivers/accel/ivpu/ivpu_hw_37xx.c | 46 +- drivers/gpu/drm/ast/ast_drv.h | 13 +- drivers/gpu/drm/ast/ast_mode.c | 62 ++--- drivers/gpu/drm/nouveau/nvkm/engine/fifo/r535.c | 2 +- drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c | 9 ++-- drivers/gpu/drm/panel/panel-simple.c| 13 +++--- drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 14 -- 7 files changed, 113 insertions(+), 46 deletions(-)
Re: [Intel-gfx] [PATCH v3 02/11] drm/dp_mst: Fix PBN divider calculation for UHBR rates
On 2023-11-17 20:40, Rodrigo Vivi wrote: On Fri, Nov 17, 2023 at 06:21:07PM +0200, Ville Syrjälä wrote: On Fri, Nov 17, 2023 at 05:09:27PM +0200, Imre Deak wrote: The current way of calculating the pbn_div value, the link BW per each MTP slot, worked only for DP 1.4 link rates. Fix things up for UHBR rates calculating with the correct channel coding efficiency based on the link rate. v2: - Return the fractional pbn_div value from drm_dp_get_vc_payload_bw(). v3: - Fix rounding up quotient while calculating req_slots. (Ville) Cc: Ville Syrjälä Cc: Lyude Paul Cc: dri-devel@lists.freedesktop.org Signed-off-by: Imre Deak Reviewed-by: Ville Syrjälä Dave, Sima, it looks like this whole series is ready for getting merged: https://patchwork.freedesktop.org/series/126526/ But it has these 3 drm/dp_mst here. Ack to merge them through drm-intel? Well, as drm-misc maintainer: Acked-by: Maarten Lankhorst --- drivers/gpu/drm/display/drm_dp_mst_topology.c | 10 +++--- include/drm/display/drm_dp_helper.h | 13 + 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/display/drm_dp_mst_topology.c b/drivers/gpu/drm/display/drm_dp_mst_topology.c index 000d05e80352a..8ca01a6bf645d 100644 --- a/drivers/gpu/drm/display/drm_dp_mst_topology.c +++ b/drivers/gpu/drm/display/drm_dp_mst_topology.c @@ -3585,14 +3585,18 @@ static int drm_dp_send_up_ack_reply(struct drm_dp_mst_topology_mgr *mgr, fixed20_12 drm_dp_get_vc_payload_bw(const struct drm_dp_mst_topology_mgr *mgr, int link_rate, int link_lane_count) { + int ch_coding_efficiency = + drm_dp_bw_channel_coding_efficiency(drm_dp_is_uhbr_rate(link_rate)); fixed20_12 ret; if (link_rate == 0 || link_lane_count == 0) drm_dbg_kms(mgr->dev, "invalid link rate/lane count: (%d / %d)\n", link_rate, link_lane_count); - /* See DP v2.0 2.6.4.2, VCPayload_Bandwidth_for_OneTimeSlotPer_MTP_Allocation */ - ret.full = dfixed_const(link_rate * link_lane_count / 54000); + /* See DP v2.0 2.6.4.2, 2.7.6.3 VCPayload_Bandwidth_for_OneTimeSlotPer_MTP_Allocation */ + ret.full = DIV_ROUND_DOWN_ULL(mul_u32_u32(link_rate * link_lane_count, + ch_coding_efficiency), + (100ULL * 8 * 5400) >> 12); return ret; } @@ -4342,7 +4346,7 @@ int drm_dp_atomic_find_time_slots(struct drm_atomic_state *state, } } - req_slots = DIV_ROUND_UP(pbn, dfixed_trunc(topology_state->pbn_div)); + req_slots = DIV_ROUND_UP(dfixed_const(pbn), topology_state->pbn_div.full); drm_dbg_atomic(mgr->dev, "[CONNECTOR:%d:%s] [MST PORT:%p] TU %d -> %d\n", port->connector->base.id, port->connector->name, diff --git a/include/drm/display/drm_dp_helper.h b/include/drm/display/drm_dp_helper.h index c5f1079acb3b1..863b2e7add29e 100644 --- a/include/drm/display/drm_dp_helper.h +++ b/include/drm/display/drm_dp_helper.h @@ -252,6 +252,19 @@ drm_edp_backlight_supported(const u8 edp_dpcd[EDP_DISPLAY_CTL_CAP_SIZE]) return !!(edp_dpcd[1] & DP_EDP_TCON_BACKLIGHT_ADJUSTMENT_CAP); } +/** + * drm_dp_is_uhbr_rate - Determine if a link rate is UHBR + * @link_rate: link rate in 10kbits/s units + * + * Determine if the provided link rate is an UHBR rate. + * + * Returns: %True if @link_rate is an UHBR rate. + */ +static inline bool drm_dp_is_uhbr_rate(int link_rate) +{ + return link_rate >= 100; +} + /* * DisplayPort AUX channel */ -- 2.39.2 -- Ville Syrjälä Intel
[PULL] drm-misc-fixes
Hi Dave, Daniel, Small pull request, mostly nouveau fixes. Cheers, ~Maarten Mostly drm-misc-fixes-2023-11-16: Assorted fixes for v6.7-rc2: - Nouveau GSP fixes. - Fix nouveau driver load without display. - Use rwlock for nouveau's event lock to break a lockdep splat. - Add orientation quirk for Lenovo Legion Go. - Fix build failure in IVPU. The following changes since commit b85ea95d086471afb4ad062012a4d73cd328fa86: Linux 6.7-rc1 (2023-11-12 16:19:07 -0800) are available in the Git repository at: git://anongit.freedesktop.org/drm/drm-misc tags/drm-misc-fixes-2023-11-16 for you to fetch changes up to ae1aadb1eb8d3cbc52e42bee71d67bd4a71f9f07: nouveau: don't fail driver load if no display hw present. (2023-11-15 18:23:31 +0100) Assorted fixes for v6.7-rc2: - Nouveau GSP fixes. - Fix nouveau driver load without display. - Use rwlock for nouveau's event lock to break a lockdep splat. - Add orientation quirk for Lenovo Legion Go. - Fix build failure in IVPU. Arnd Bergmann (1): accel/ivpu: avoid build failure with CONFIG_PM=n Brenton Simpson (1): drm: panel-orientation-quirks: Add quirk for Lenovo Legion Go Dan Carpenter (2): nouveau/gsp/r535: uninitialized variable in r535_gsp_acpi_mux_id() nouveau/gsp/r535: Fix a NULL vs error pointer bug Dave Airlie (2): nouveau: use an rwlock for the event lock. nouveau: don't fail driver load if no display hw present. drivers/accel/ivpu/ivpu_pm.c | 3 --- drivers/gpu/drm/drm_panel_orientation_quirks.c| 6 ++ drivers/gpu/drm/nouveau/include/nvkm/core/event.h | 4 ++-- drivers/gpu/drm/nouveau/nouveau_display.c | 5 + drivers/gpu/drm/nouveau/nvkm/core/event.c | 12 ++-- drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c| 6 +++--- 6 files changed, 22 insertions(+), 14 deletions(-)
Re: [PATCH] driver: gpu: Fixing warning directly dereferencing a rcu pointer
Hey, Den 2023-11-13 kl. 09:10, skrev Abhinav Singh: This patch fixes a sparse warning with this message "warning:dereference of noderef expression". In this context it means we are dereferencing a __rcu tagged pointer directly. We should not be directly dereferencing a rcu pointer, rather we should be using rcu helper function rcu_dereferece() inside rcu read critical section to get a normal pointer which can be dereferenced. I tested with qemu with this command qemu-system-x86_64 \ -m 2G \ -smp 2 \ -kernel bzImage \ -append "console=ttyS0 root=/dev/sda earlyprintk=serial net.ifnames=0" \ -drive file=bullseye.img,format=raw \ -net user,host=10.0.2.10,hostfwd=tcp:127.0.0.1:10021-:22 \ -net nic,model=e1000 \ -enable-kvm \ -nographic \ -pidfile vm.pid \ 2>&1 | tee vm.log with lockdep enabled. Signed-off-by: Abhinav Singh --- drivers/gpu/drm/nouveau/nv04_fence.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/nouveau/nv04_fence.c b/drivers/gpu/drm/nouveau/nv04_fence.c index 5b71a5a5cd85..e62bad1ac720 100644 --- a/drivers/gpu/drm/nouveau/nv04_fence.c +++ b/drivers/gpu/drm/nouveau/nv04_fence.c @@ -39,7 +39,9 @@ struct nv04_fence_priv { static int nv04_fence_emit(struct nouveau_fence *fence) { - struct nvif_push *push = fence->channel->chan.push; + rcu_read_lock(); + struct nvif_push *push = rcu_dereference(fence->channel)->chan.push; + rcu_read_unlock(); int ret = PUSH_WAIT(push, 2); if (ret == 0) { PUSH_NVSQ(push, NV_SW, 0x0150, fence->base.seqno); I'm not an expert in nouveau fence channel lifetime, but I'm pretty sure this should probably be a rcu_dereference_protected, since a fence likely can't lose its channel before its command to signal is submitted. But in case it's not, I would at least advise to check for fence->channel lifetime before submitting a patch like this. At least the original code warned about it not being 100% correct. Cheers, ~Maarten
[PULL] drm-misc-fixes
Hi Dave, Daniel, drm-misc-next-fixes is empty, have a pull request for drm-misc-fixes. Cheers, ~Maarten drm-misc-fixes-2023-11-08: drm-misc-fixes for v6.7-rc1: - drm-misc-fixes from 2023-11-02 + a single qxl memory leak fix. The following changes since commit 8f5ad367e8b884772945c6c9fb622ac94b7d3e32: accel/ivpu: Extend address range for MMU mmap (2023-10-19 08:01:20 +0200) are available in the Git repository at: git://anongit.freedesktop.org/drm/drm-misc tags/drm-misc-fixes-2023-11-08 for you to fetch changes up to 0e8b9f258baed25f1c5672613699247c76b007b5: drm/qxl: prevent memory leak (2023-11-06 09:37:03 +0100) drm-misc-fixes for v6.7-rc1: - drm-misc-fixes from 2023-11-02 + a single qxl memory leak fix. Christian König (2): drm/amdgpu: ignore duplicate BOs again drm/amdkfd: reserve a fence slot while locking the BO Erik Kurzinger (1): drm/syncobj: fix DRM_SYNCOBJ_WAIT_FLAGS_WAIT_AVAILABLE Karol Wachowski (1): accel/ivpu/37xx: Fix missing VPUIP interrupts Luben Tuikov (1): drm/amdgpu: Remove redundant call to priority_is_valid() Lukasz Majczak (1): drm/dp_mst: Fix NULL deref in get_mst_branch_device_by_guid_helper() Maxime Ripard (1): drm/vc4: tests: Fix UAF in the mock helpers Sui Jingfeng (1): drm/logicvc: Kconfig: select REGMAP and REGMAP_MMIO Zongmin Zhou (1): drm/qxl: prevent memory leak drivers/accel/ivpu/ivpu_hw_37xx.c| 11 +-- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 3 ++- drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c | 15 --- drivers/gpu/drm/display/drm_dp_mst_topology.c| 6 +++--- drivers/gpu/drm/drm_syncobj.c| 3 ++- drivers/gpu/drm/logicvc/Kconfig | 2 ++ drivers/gpu/drm/qxl/qxl_display.c| 3 +++ drivers/gpu/drm/vc4/tests/vc4_mock_crtc.c| 2 +- drivers/gpu/drm/vc4/tests/vc4_mock_output.c | 2 +- 10 files changed, 28 insertions(+), 21 deletions(-)
[PULL] drm-misc-next-fixes
Hi Daniel, Dave, Just 2 small ssd130x fixes. Cheers, ~Maarten drm-misc-next-fixes-2023-11-02: drm-misc-next-fixes for v6.7-rc1: - dt binding fix for ssd132x - Initialize ssd130x crtc_state to NULL. The following changes since commit b70438004a14f4d0f9890b3297cd66248728546c: drm/amdgpu: move buffer funcs setting up a level (2023-10-26 16:04:24 -0400) are available in the Git repository at: git://anongit.freedesktop.org/drm/drm-misc tags/drm-misc-next-fixes-2023-11-02 for you to fetch changes up to 94565e95e247c188fed4d3da1034402f3fb297de: drm/ssd130x: Fix possible uninitialized usage of crtc_state variable (2023-10-30 11:00:27 +0100) drm-misc-next-fixes for v6.7-rc1: - dt binding fix for ssd132x - Initialize ssd130x crtc_state to NULL. Javier Martinez Canillas (2): dt-bindings: display: ssd132x: Remove '-' before compatible enum drm/ssd130x: Fix possible uninitialized usage of crtc_state variable Documentation/devicetree/bindings/display/solomon,ssd132x.yaml | 8 drivers/gpu/drm/solomon/ssd130x.c | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-)
[PULL] drm-misc-next
drm-misc-next-2023-10-27: drm-misc-next for v6.7-rc1: drm-misc-next-2023-10-19 + following: UAPI Changes: Cross-subsystem Changes: - Convert fbdev drivers to use fbdev i/o mem helpers. Core Changes: - Use cross-references for macros in docs. - Make drm_client_buffer_addb use addfb2. - Add NV20 and NV30 YUV formats. - Documentation updates for create_dumb ioctl. - CI fixes. - Allow variable number of run-queues in scheduler. Driver Changes: - Rename drm/ast constants. - Make ili9882t its own driver. - Assorted fixes in ivpu, vc4, bridge/synopsis, amdgpu. - Add planar formats to rockchip. The following changes since commit c395c83aafbb9cdbe4230f044d5b8eaf9080c0c5: drm/simpledrm: Fix power domain device link validity check (2023-10-12 10:39:48 +0200) are available in the Git repository at: git://anongit.freedesktop.org/drm/drm-misc tags/drm-misc-next-2023-10-27 for you to fetch changes up to b70438004a14f4d0f9890b3297cd66248728546c: drm/amdgpu: move buffer funcs setting up a level (2023-10-26 16:04:24 -0400) drm-misc-next for v6.7-rc1: drm-misc-next-2023-10-19 + following: UAPI Changes: Cross-subsystem Changes: - Convert fbdev drivers to use fbdev i/o mem helpers. Core Changes: - Use cross-references for macros in docs. - Make drm_client_buffer_addb use addfb2. - Add NV20 and NV30 YUV formats. - Documentation updates for create_dumb ioctl. - CI fixes. - Allow variable number of run-queues in scheduler. Driver Changes: - Rename drm/ast constants. - Make ili9882t its own driver. - Assorted fixes in ivpu, vc4, bridge/synopsis, amdgpu. - Add planar formats to rockchip. Alex Deucher (1): drm/amdgpu: move buffer funcs setting up a level Andy Yan (6): drm/rockchip: remove unused struct in vop2 drm/rockchip: remove NR_LAYERS macro on vop2 drm/rockchip: vop: fix format bpp calculation drm/rockchip: vop2: remove the unsupported format of cluster window drm/rockchip: vop2: Add more supported 10bit formats drm/rockchip: vop2: rename window formats to show window type using them Biju Das (8): drm: adv7511: Add struct adv7511_chip_info and use i2c_get_match_data() drm: adv7511: Add max_mode_clock_khz variable to struct adv7511_chip_info drm: adv7511: Add max_lane_freq_khz variable to struct adv7511_chip_info drm: adv7511: Add supply_names and num_supplies variables to struct adv7511_chip_info drm: adv7511: Add reg_cec_offset variable to struct adv7511_chip_info drm: adv7511: Add has_dsi variable to struct adv7511_chip_info drm: adv7511: Add link_config variable to struct adv7511_chip_info drm: adv7511: Add hpd_override_enable variable to struct adv7511_chip_info Chris Morgan (3): dt-bindings: vendor-prefixes: document Powkiddy dt-bindings: panel: Add Powkiddy RGB30 panel compatible drm/panel: st7703: Add Powkiddy RGB30 Panel Support Cong Yang (3): drm/panel: ili9882t: Break out as separate driver drm/panel: ili9882t: Avoid blurred screen from fast sleep arm64: defconfig: Enable ILITEK_ILI9882T panel Dan Carpenter (1): drm/rockchip: Fix type promotion bug in rockchip_gem_iommu_map() Dario Binacchi (1): drm/vc4: fix typo Deepak R Varma (1): accel/ivpu: Delete the TODO file Dmitry Baryshkov (3): drm/bridge: lt9611uxc: fix the race in the error path drm/ci: pick up -external-fixes from the merge target repo drm/ci: force-enable CONFIG_MSM_MMCC_8996 as built-in Frank Oltmanns (1): drm/panel: st7703: Fix timings when entering/exiting sleep Geert Uytterhoeven (1): drm/client: Convert drm_client_buffer_addfb() to drm_mode_addfb2() Helen Koike (11): drm/ci: uprev mesa version: fix container build & crosvm drm/ci: fix DEBIAN_ARCH and get amdgpu probing drm/ci: add helper script update-xfails.py drm/ci: uprev IGT and make sure core_getversion is run drm/ci: clean up xfails (specially flakes list) drm/ci: add subset-1-gfx to LAVA_TAGS and adjust shards drm/ci: increase i915 job timeout to 1h30m drm/ci: export kernel config drm/ci: do not automatically retry on error drm/ci: docs: add step about how to request privileges MAINTAINERS: drm/ci: add entries for xfail files Ian Ray (2): drm/bridge: megachips-stdp-ge-b850v3-fw: switch to drm_do_get_edid() MAINTAINERS: Update entry for megachips-stdp-ge-b850v3-fw Jacek Lawrynowicz (1): accel/ivpu: Add ivpu_bo_vaddr() and ivpu_bo_size() Javier Martinez Canillas (6): drm/ssd130x: Replace .page_height field in device info with a constant drm/ssd130x: Add a controller family id to the device info data drm/ssd130x: Rename commands that are shared across chip families drm/ssd130x: Add support for the SSD132x OLED controller family
[PULL] drm-misc-next
drm-misc-next-2023-10-19: drm-misc-next for v6.7-rc1: UAPI Changes: Cross-subsystem Changes: - Update maintainers entry for megachips STDPx-GE-B850V3-FW. Core Changes: - Add VM_BIND async document. - Dual-license drm_gpuvm to GPL-2.0 OR MIT. Driver Changes: - Assorted small fixes in ivpu, bridge/megachips, ssd130x, st7703, bridge/lt9611uxc, rockchip. - Handle differences between various adv7511 chips better, and improve HPD handling. - Clock fixes for bridge/synopsis dw-mipi-dsi. - Add Powkiddy RGB30 support to st7703. - Add driver and DT support for ssd132x OLED controller to ssd130x. The following changes since commit c395c83aafbb9cdbe4230f044d5b8eaf9080c0c5: drm/simpledrm: Fix power domain device link validity check (2023-10-12 10:39:48 +0200) are available in the Git repository at: git://anongit.freedesktop.org/drm/drm-misc tags/drm-misc-next-2023-10-19 for you to fetch changes up to 2d23e7d6bacb779c4a740dbd5e18978fb075d15e: dt-bindings: display: Add SSD132x OLED controllers (2023-10-18 09:53:33 +0200) drm-misc-next for v6.7-rc1: UAPI Changes: Cross-subsystem Changes: - Update maintainers entry for megachips STDPx-GE-B850V3-FW. Core Changes: - Add VM_BIND async document. - Dual-license drm_gpuvm to GPL-2.0 OR MIT. Driver Changes: - Assorted small fixes in ivpu, bridge/megachips, ssd130x, st7703, bridge/lt9611uxc, rockchip. - Handle differences between various adv7511 chips better, and improve HPD handling. - Clock fixes for bridge/synopsis dw-mipi-dsi. - Add Powkiddy RGB30 support to st7703. - Add driver and DT support for ssd132x OLED controller to ssd130x. Andy Yan (2): drm/rockchip: remove unused struct in vop2 drm/rockchip: remove NR_LAYERS macro on vop2 Biju Das (8): drm: adv7511: Add struct adv7511_chip_info and use i2c_get_match_data() drm: adv7511: Add max_mode_clock_khz variable to struct adv7511_chip_info drm: adv7511: Add max_lane_freq_khz variable to struct adv7511_chip_info drm: adv7511: Add supply_names and num_supplies variables to struct adv7511_chip_info drm: adv7511: Add reg_cec_offset variable to struct adv7511_chip_info drm: adv7511: Add has_dsi variable to struct adv7511_chip_info drm: adv7511: Add link_config variable to struct adv7511_chip_info drm: adv7511: Add hpd_override_enable variable to struct adv7511_chip_info Chris Morgan (3): dt-bindings: vendor-prefixes: document Powkiddy dt-bindings: panel: Add Powkiddy RGB30 panel compatible drm/panel: st7703: Add Powkiddy RGB30 Panel Support Dan Carpenter (1): drm/rockchip: Fix type promotion bug in rockchip_gem_iommu_map() Dmitry Baryshkov (1): drm/bridge: lt9611uxc: fix the race in the error path Frank Oltmanns (1): drm/panel: st7703: Fix timings when entering/exiting sleep Ian Ray (2): drm/bridge: megachips-stdp-ge-b850v3-fw: switch to drm_do_get_edid() MAINTAINERS: Update entry for megachips-stdp-ge-b850v3-fw Jacek Lawrynowicz (1): accel/ivpu: Add ivpu_bo_vaddr() and ivpu_bo_size() Javier Martinez Canillas (6): drm/ssd130x: Replace .page_height field in device info with a constant drm/ssd130x: Add a controller family id to the device info data drm/ssd130x: Rename commands that are shared across chip families drm/ssd130x: Add support for the SSD132x OLED controller family dt-bindings: display: Split common Solomon properties in their own schema dt-bindings: display: Add SSD132x OLED controllers Liu Ying (9): drm/bridge: synopsys: dw-mipi-dsi: Add dw_mipi_dsi_get_bridge() helper drm/bridge: synopsys: dw-mipi-dsi: Add input bus format negotiation support drm/bridge: synopsys: dw-mipi-dsi: Force input bus flags drm/bridge: synopsys: dw-mipi-dsi: Add mode fixup support drm/bridge: synopsys: dw-mipi-dsi: Use pixel clock rate to calculate lbcc drm/bridge: synopsys: dw-mipi-dsi: Set minimum lane byte clock cycles for HSA and HBP drm/bridge: synopsys: dw-mipi-dsi: Disable HSTX and LPRX timeout check dt-bindings: display: bridge: Document Freescale i.MX93 MIPI DSI drm/bridge: imx: Add i.MX93 MIPI DSI support Ondrej Jirman (1): drm/panel: st7703: Pick different reset sequence Thomas Hellström (2): Documentation/gpu: Add a VM_BIND async document drm/gpuvm: Dual-licence the drm_gpuvm code GPL-2.0 OR MIT Thomas Zimmermann (1): drm/ssd130x: Fix atomic_check for disabled planes .../display/bridge/fsl,imx93-mipi-dsi.yaml | 115 +++ .../display/panel/rocktech,jh057n00900.yaml| 2 + .../bindings/display/solomon,ssd-common.yaml | 42 + .../bindings/display/solomon,ssd1307fb.yaml| 28 +- .../bindings/display/solomon,ssd132x.yaml | 89 ++
[PULL] drm-misc-next
drm-misc-next-2023-10-12: drm-misc-next for v6.7-rc1: Contains the previous pull request drm-misc-next-2023-10-06 + following: Cross-subsystem Changes: - Rename fb_pgprot to pgprot_framebuffer and remove file argument/ - Update iosys-map documentation typos. Core Changes: - Assorted fixes to drm/panel. - Add HPD state to drm_connector_oob_hotplug_event(), and implement oob hotplug events in bridge connector. - Replace drm_framebuffer_plane_width/height with calls to drm_format_info_plane_width/height. Driver Changes: - Clock and debug fixes for bridge/samsung-dsim. - More btree -> maple tree conversions. - Assorted bugfixes in rockchip, panel-tpo-tpg110, - Add LTK050H3148W-CTA6 panel support. - Assorted small fixes in host1x, tegra, simpledrm. - Suspend fixes for host1x. The following changes since commit 389af786f92ecdff35883551d54bf4e507ffcccb: Merge tag 'drm-intel-next-2023-09-29' of git://anongit.freedesktop.org/drm/drm-intel into drm-next (2023-10-04 13:55:19 +1000) are available in the Git repository at: git://anongit.freedesktop.org/drm/drm-misc tags/drm-misc-next-2023-10-12 for you to fetch changes up to c395c83aafbb9cdbe4230f044d5b8eaf9080c0c5: drm/simpledrm: Fix power domain device link validity check (2023-10-12 10:39:48 +0200) drm-misc-next for v6.7-rc1: Contains the previous pull request drm-misc-next-2023-10-06 + following: Cross-subsystem Changes: - Rename fb_pgprot to pgprot_framebuffer and remove file argument/ - Update iosys-map documentation typos. Core Changes: - Assorted fixes to drm/panel. - Add HPD state to drm_connector_oob_hotplug_event(), and implement oob hotplug events in bridge connector. - Replace drm_framebuffer_plane_width/height with calls to drm_format_info_plane_width/height. Driver Changes: - Clock and debug fixes for bridge/samsung-dsim. - More btree -> maple tree conversions. - Assorted bugfixes in rockchip, panel-tpo-tpg110, - Add LTK050H3148W-CTA6 panel support. - Assorted small fixes in host1x, tegra, simpledrm. - Suspend fixes for host1x. Adrián Larumbe (6): drm/panfrost: Add cycle count GPU register definitions drm/panfrost: Add fdinfo support GPU load metrics drm/panfrost: Add fdinfo support for memory stats drm/drm_file: Add DRM obj's RSS reporting function for fdinfo drm/panfrost: Implement generic DRM object RSS reporting function Documentation/gpu: fix Panfrost documentation build warnings André Almeida (1): drm/doc: Document DRM device reset expectations Arnd Bergmann (1): drm/nouveau/kms/nv50: hide unused variables Arthur Grillo (2): drm/tests: Add calls to drm_fb_blit() on supported format conversion tests drm/tests: Add new format conversion tests to better cover drm_fb_blit() Bjorn Andersson (1): drm: Add HPD state to drm_connector_oob_hotplug_event() Carlos Eduardo Gallo Filho (2): drm: Remove plane hsub/vsub alignment requirement for core helpers drm: Replace drm_framebuffer plane size functions with its equivalents Chris Morgan (2): dt-bindings: display: newvision,nv3051d: Add Anbernic 351V drm/panel: nv3051d: Add Support for Anbernic 351V Christophe JAILLET (1): drm/rockchip: cdn-dp: Fix some error handling paths in cdn_dp_probe() Danilo Krummrich (1): drm/gpuvm: doc: fix filename references Dmitry Baryshkov (2): drm/bridge_connector: stop filtering events in drm_bridge_connector_hpd_cb() drm/bridge_connector: implement oob_hotplug_event Douglas Anderson (1): MAINTAINERS: Document that the NXP i.MX 8MQ DCSS driver goes thru drm-misc Jani Nikula (3): drm/bridge: use drm_bridge_get_edid() instead of using ->get_edid directly drm/bridge: lt9611uxc: use drm_bridge_get_edid() instead of using ->get_edid directly drm/dp: switch drm_dp_downstream_*() helpers to struct drm_edid Johannes Zink (3): dt-bindings: display: move LVDS data-mapping definition to separate file dt-bindings: display: simple: support non-default data-mapping drm/panel-simple: allow LVDS format override Johnny Liu (1): gpu: host1x: Correct allocated size for contexts Justin Stitt (1): drm/gma500: refactor deprecated strncpy Kees Cook (9): drm/amd/pm: Annotate struct smu10_voltage_dependency_table with __counted_by drm/amdgpu/discovery: Annotate struct ip_hw_instance with __counted_by drm/i915/selftests: Annotate struct perf_series with __counted_by drm/msm/dpu: Annotate struct dpu_hw_intr with __counted_by drm/nouveau/pm: Annotate struct nvkm_perfdom with __counted_by drm/vc4: Annotate struct vc4_perfmon with __counted_by drm/virtio: Annotate struct virtio_gpu_object_array with __counted_by drm/vmwgfx: Annotate struct vmw_surface_dirty with __counted_by drm/v3d: Annotate
[PULL] drm-misc-next
drm-misc-next-2023-10-06: drm-misc-next for v6.7: Cross-subsystem Changes: - drm-misc now matches all drivers to ensure it goes to the correct tree. - Clarify NXP i.MX 8MQ DCSS goes through drm-misc tree in MAINTAINERS. Core Changes: - Assorted small fixes in gpuvm, bridge. - Improve format conversion tests. - Document DRM device reset expectations. - Warn when vblank worker is cancelled. - Allow more accurate reporting of RSS and use it in panfrost. - Use struct drm_edid in drm_dp_downstream helpers. Driver Changes: - Assorted small fixes in gma500, ivpu, nouveau, bridge/lt9611uxc, amdgpu, exynos/dsi. - Convert quite a few drm/bridge drivers to use maple tree register cache. - Add BOE RM692E5 AMOLED, Anbernic 351V panels. - Add fdinfo support for panfrost memor ystat and gpu load metrics, including some documentation updates. - Update drivers variable sized ararys by using __counted_by. - The following changes since commit 78f54469b871db5ba8ea49abd4e5994e97bd525b: drm/nouveau: uvmm: rename 'umgr' to 'base' (2023-09-26 01:58:29 +0200) are available in the Git repository at: git://anongit.freedesktop.org/drm/drm-misc tags/drm-misc-next-2023-10-06 for you to fetch changes up to c1698c73f4aaef2fd406da1c0a92e1c8f7b7780c: drm: exynos: dsi: Convert to platform remove callback returning void (2023-10-06 08:58:44 +0200) drm-misc-next for v6.7: Cross-subsystem Changes: - drm-misc now matches all drivers to ensure it goes to the correct tree. - Clarify NXP i.MX 8MQ DCSS goes through drm-misc tree in MAINTAINERS. Core Changes: - Assorted small fixes in gpuvm, bridge. - Improve format conversion tests. - Document DRM device reset expectations. - Warn when vblank worker is cancelled. - Allow more accurate reporting of RSS and use it in panfrost. - Use struct drm_edid in drm_dp_downstream helpers. Driver Changes: - Assorted small fixes in gma500, ivpu, nouveau, bridge/lt9611uxc, amdgpu, exynos/dsi. - Convert quite a few drm/bridge drivers to use maple tree register cache. - Add BOE RM692E5 AMOLED, Anbernic 351V panels. - Add fdinfo support for panfrost memor ystat and gpu load metrics, including some documentation updates. - Update drivers variable sized ararys by using __counted_by. - Adrián Larumbe (5): drm/panfrost: Add cycle count GPU register definitions drm/panfrost: Add fdinfo support GPU load metrics drm/panfrost: Add fdinfo support for memory stats drm/drm_file: Add DRM obj's RSS reporting function for fdinfo drm/panfrost: Implement generic DRM object RSS reporting function André Almeida (1): drm/doc: Document DRM device reset expectations Arnd Bergmann (1): drm/nouveau/kms/nv50: hide unused variables Arthur Grillo (2): drm/tests: Add calls to drm_fb_blit() on supported format conversion tests drm/tests: Add new format conversion tests to better cover drm_fb_blit() Chris Morgan (2): dt-bindings: display: newvision,nv3051d: Add Anbernic 351V drm/panel: nv3051d: Add Support for Anbernic 351V Danilo Krummrich (1): drm/gpuvm: doc: fix filename references Douglas Anderson (1): MAINTAINERS: Document that the NXP i.MX 8MQ DCSS driver goes thru drm-misc Jani Nikula (3): drm/bridge: use drm_bridge_get_edid() instead of using ->get_edid directly drm/bridge: lt9611uxc: use drm_bridge_get_edid() instead of using ->get_edid directly drm/dp: switch drm_dp_downstream_*() helpers to struct drm_edid Justin Stitt (1): drm/gma500: refactor deprecated strncpy Kees Cook (9): drm/amd/pm: Annotate struct smu10_voltage_dependency_table with __counted_by drm/amdgpu/discovery: Annotate struct ip_hw_instance with __counted_by drm/i915/selftests: Annotate struct perf_series with __counted_by drm/msm/dpu: Annotate struct dpu_hw_intr with __counted_by drm/nouveau/pm: Annotate struct nvkm_perfdom with __counted_by drm/vc4: Annotate struct vc4_perfmon with __counted_by drm/virtio: Annotate struct virtio_gpu_object_array with __counted_by drm/vmwgfx: Annotate struct vmw_surface_dirty with __counted_by drm/v3d: Annotate struct v3d_perfmon with __counted_by Konrad Dybcio (2): dt-bindings: display: panel: Add Raydium RM692E5 drm/panel: Add driver for BOE RM692E5 AMOLED panel Mark Brown (8): drm/bridge: adv7511: Convert to use maple tree register cache drm/bridge: dpc3433: Convert to use maple tree register cache drm/bridge: tc358767: Convert to use maple tree register cache drm/bridge: icn6211: Convert to use maple tree register cache drm/bridge: lt9211: Convert to use maple tree register cache drm/bridge: sn65dsi83: Convert to use maple tree register cache drm/panel: ili9322: Remove redundant volatle_reg() operation drm/panel: ili9322: Convert to
[PULL] drm-misc-next
drm-misc-next-2023-09-27: drm-misc-next for v6.7-rc1: UAPI Changes: - drm_file owner is now updated during use, in the case of a drm fd opened by the display server for a client, the correct owner is displayed. - Qaic gains support for the QAIC_DETACH_SLICE_BO ioctl to allow bo recycling. Cross-subsystem Changes: - Disable boot logo for au1200fb, mmpfb and unexport logo helpers. Only fbcon should manage display of logo. - Update freescale in MAINTAINERS. - Add some bridge files to bridge in MAINTAINERS. - Update gma500 driver repo in MAINTAINERS to point to drm-misc. Core Changes: - Move size computations to drm buddy allocator. - Make drm_atomic_helper_shutdown(NULL) a nop. - Assorted small fixes in drm_debugfs, DP-MST payload addition error handling. - Fix DRM_BRIDGE_ATTACH_NO_CONNECTOR handling. - Handle bad (h/v)sync_end in EDID by clipping to htotal. - Build GPUVM as a module. Driver Changes: - Simple drivers don't need to cache prepared result. - Call drm_atomic_helper_shutdown() in shutdown/unbind for a whole lot more drm drivers. - Assorted small fixes in amdgpu, ssd130x, bridge/it6621, accel/qaic, nouveau, tc358768. - Add NV12 for komeda writeback. - Add arbitration lost event to synopsis/dw-hdmi-cec. - Speed up s/r in nouveau by not restoring some big bo's. - Assorted nouveau display rework in preparation for GSP-RM, especially related to how the modeset sequence works and the DP sequence in relation to link training. - Update anx7816 panel. - Support NVSYNC and NHSYNC in tegra. - Allow multiple power domains in simple driver. The following changes since commit 15d30b46573d75f5cb58cfacded8ebab9c76a2b0: drm/ssd130x: Use bool for ssd130x_deviceinfo flags (2023-09-10 09:05:47 +0200) are available in the Git repository at: git://anongit.freedesktop.org/drm/drm-misc tags/drm-misc-next-2023-09-27 for you to fetch changes up to 78f54469b871db5ba8ea49abd4e5994e97bd525b: drm/nouveau: uvmm: rename 'umgr' to 'base' (2023-09-26 01:58:29 +0200) drm-misc-next for v6.7-rc1: UAPI Changes: - drm_file owner is now updated during use, in the case of a drm fd opened by the display server for a client, the correct owner is displayed. - Qaic gains support for the QAIC_DETACH_SLICE_BO ioctl to allow bo recycling. Cross-subsystem Changes: - Disable boot logo for au1200fb, mmpfb and unexport logo helpers. Only fbcon should manage display of logo. - Update freescale in MAINTAINERS. - Add some bridge files to bridge in MAINTAINERS. - Update gma500 driver repo in MAINTAINERS to point to drm-misc. Core Changes: - Move size computations to drm buddy allocator. - Make drm_atomic_helper_shutdown(NULL) a nop. - Assorted small fixes in drm_debugfs, DP-MST payload addition error handling. - Fix DRM_BRIDGE_ATTACH_NO_CONNECTOR handling. - Handle bad (h/v)sync_end in EDID by clipping to htotal. - Build GPUVM as a module. Driver Changes: - Simple drivers don't need to cache prepared result. - Call drm_atomic_helper_shutdown() in shutdown/unbind for a whole lot more drm drivers. - Assorted small fixes in amdgpu, ssd130x, bridge/it6621, accel/qaic, nouveau, tc358768. - Add NV12 for komeda writeback. - Add arbitration lost event to synopsis/dw-hdmi-cec. - Speed up s/r in nouveau by not restoring some big bo's. - Assorted nouveau display rework in preparation for GSP-RM, especially related to how the modeset sequence works and the DP sequence in relation to link training. - Update anx7816 panel. - Support NVSYNC and NHSYNC in tegra. - Allow multiple power domains in simple driver. Alicja Michalska (2): dt-bindings: display: anx7814: Add definition for anx7816 drm/bridge/analogix/anx78xx: Add missing definition AngeloGioacchino Del Regno (1): drm/bridge: panel: Fix device link for DRM_BRIDGE_ATTACH_NO_CONNECTOR Arunpravin Paneer Selvam (3): drm/buddy: Improve contiguous memory allocation drm/amdgpu: Move the size computations to drm buddy drm/i915: Move the size computations to drm buddy Ben Skeggs (43): drm/nouveau/devinit/tu102-: remove attempt at loading PreOS drm/nouveau/imem: support allocations not preserved across suspend drm/nouveau/gr/gf100-: lose contents of global ctxbufs across suspend drm/nouveau/mmu/gp100-: always invalidate TLBs at CACHE_LEVEL_ALL drm/nouveau/kms/nv50-: fix mst payload alloc fail crashing evo drm/nouveau/disp: rearrange output methods drm/nouveau/disp: add output detect method drm/nouveau/disp: add output method to fetch edid drm/nouveau/disp: rename internal output acquire/release functions drm/nouveau/disp: shuffle to make upcoming diffs prettier drm/nouveau/disp: add acquire_dac() drm/nouveau/disp: add acquire_sor/pior() drm/nouveau/disp: update SOR routing immediately on acquire()
[PULL] drm-misc-next
Hi Dave, Daniel, First pull request for next kernel cycle. Cheers, ~Maarten drm-misc-next-2023-09-11-1: drm-misc-next for v6.7-rc1: UAPI Changes: - Nouveau changed to not set NO_PREFETCH flag explicitly. Cross-subsystem Changes: - Update documentation of dma-buf intro and uapi. - fbdev/sbus fixes. - Use initializer macros in a lot of fbdev drivers. - Add Boris Brezillon as Panfrost driver maintainer. - Add Jessica Zhang as drm/panel reviewer. - Make more fbdev drivers use fb_ops helpers for deferred io. - Small hid trailing whitespace fix. - Use fb_ops in hid/picolcd Core Changes: - Assorted small fixes to ttm tests, drm/mst. - Documentation updates to bridge. - Add kunit tests for some drm_fb functions. - Rework drm_debugfs implementation. - Update xe documentation to mark todos as completed. Driver Changes: - Add support to rockchip for rv1126 mipi-dsi and vop. - Assorted small fixes to nouveau, bridge/samsung-dsim, bridge/lvds-codec, loongson, rockchip, panfrost, gma500, repaper, komeda, virtio, ssd130x. - Add support for simple panels Mitsubishi AA084XE01, JDI LPM102A188A, - Documentation updates to accel/ivpu. - Some nouveau scheduling/fence fixes. - Power management related fixes and other fixes to ivpu. - Assorted bridge/it66121 fixes. - Make platform drivers return void in remove() callback. The following changes since commit 2799804ac651da1375ecb9b9a644eba97218df07: drm/ttm: Remove two unused function declarations (2023-08-10 09:12:08 +0200) are available in the Git repository at: git://anongit.freedesktop.org/drm/drm-misc tags/drm-misc-next-2023-09-11-1 for you to fetch changes up to 15d30b46573d75f5cb58cfacded8ebab9c76a2b0: drm/ssd130x: Use bool for ssd130x_deviceinfo flags (2023-09-10 09:05:47 +0200) drm-misc-next for v6.7-rc1: UAPI Changes: - Nouveau changed to not set NO_PREFETCH flag explicitly. Cross-subsystem Changes: - Update documentation of dma-buf intro and uapi. - fbdev/sbus fixes. - Use initializer macros in a lot of fbdev drivers. - Add Boris Brezillon as Panfrost driver maintainer. - Add Jessica Zhang as drm/panel reviewer. - Make more fbdev drivers use fb_ops helpers for deferred io. - Small hid trailing whitespace fix. - Use fb_ops in hid/picolcd Core Changes: - Assorted small fixes to ttm tests, drm/mst. - Documentation updates to bridge. - Add kunit tests for some drm_fb functions. - Rework drm_debugfs implementation. - Update xe documentation to mark todos as completed. Driver Changes: - Add support to rockchip for rv1126 mipi-dsi and vop. - Assorted small fixes to nouveau, bridge/samsung-dsim, bridge/lvds-codec, loongson, rockchip, panfrost, gma500, repaper, komeda, virtio, ssd130x. - Add support for simple panels Mitsubishi AA084XE01, JDI LPM102A188A, - Documentation updates to accel/ivpu. - Some nouveau scheduling/fence fixes. - Power management related fixes and other fixes to ivpu. - Assorted bridge/it66121 fixes. - Make platform drivers return void in remove() callback. Alexander Stein (1): drm/bridge: lvds-codec: Implement atomic_get_input_bus_fmts for LVDS encoder Arthur Grillo (8): drm/tests: Test default pitch fallback drm/tests: Add KUnit tests for drm_fb_swab() drm/tests: Add KUnit tests for drm_fb_clip_offset() drm/tests: Add KUnit tests for drm_fb_build_fourcc_list() drm/tests: Add multi-plane support to conversion_buf_size() drm/tests: Add KUnit tests for drm_fb_memcpy() drm/debugfs: Add inline to drm_debugfs_dev_init() to suppres -Wunused-function drm/tests: Zero initialize fourccs_out Biju Das (5): drm: bridge: it66121: Extend match support for OF tables drm: bridge: it66121: Simplify probe() drm/bridge/analogix/anx78xx: Drop ID table drm/bridge: Drop conditionals around of_node pointers drm/bridge: Drop CONFIG_OF conditionals around of_node pointers Christian König (5): drm/debugfs: drop debugfs_init() for the render and accel node v2 drm/debugfs: disallow debugfs access when device isn't registered drm/debugfs: rework debugfs directory creation v5 drm/debugfs: remove dev->debugfs_list and debugfs_mutex v2 drm/debugfs: rework drm_debugfs_create_files implementation v2 Daniel Stone (2): doc: dma-buf: Rewrite intro section a little doc: uapi: Add document describing dma-buf semantics Danilo Krummrich (3): drm/nouveau: sched: avoid job races between entities drm/nouveau: uvmm: fix unset region pointer on remap drm/nouveau: uapi: don't pass NO_PREFETCH flag implicitly Dave Airlie (1): nouveau/u_memcpya: use vmemdup_user David Heidelberg (2): drm/panel: JDI LT070ME05000 drop broken link drm/panel: JDI LT070ME05000 simplify with dev_err_probe() Diogo Ivo (2): dt-bindings: display: Add bindings for JDI LPM102A188A
[PATCH 1/2] drm/i915: Swap ggtt_vma during legacy cursor update
Signed-off-by: Maarten Lankhorst --- drivers/gpu/drm/i915/display/intel_cursor.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_cursor.c b/drivers/gpu/drm/i915/display/intel_cursor.c index b342fad180ca..ab25f019eda1 100644 --- a/drivers/gpu/drm/i915/display/intel_cursor.c +++ b/drivers/gpu/drm/i915/display/intel_cursor.c @@ -688,9 +688,8 @@ intel_legacy_cursor_update(struct drm_plane *_plane, if (ret) goto out_free; - ret = intel_plane_pin_fb(new_plane_state); - if (ret) - goto out_free; + /* magic trick! */ + swap(new_plane_state->ggtt_vma, old_plane_state->ggtt_vma); intel_frontbuffer_flush(to_intel_frontbuffer(new_plane_state->hw.fb), ORIGIN_CURSOR_UPDATE); -- 2.39.2
[PATCH 2/2] drm/i915: Handle legacy cursor update as normal update
Abuse the vblank worker to make the changes as small as possible. We need a way to sync flip_done, but if we wait on flip_done, all async tests start failing. Signed-off-by: Maarten Lankhorst --- drivers/gpu/drm/i915/display/intel_crtc.c| 21 ++-- drivers/gpu/drm/i915/display/intel_crtc.h| 6 -- drivers/gpu/drm/i915/display/intel_display.c | 10 +++--- 3 files changed, 26 insertions(+), 11 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_crtc.c b/drivers/gpu/drm/i915/display/intel_crtc.c index 182c6dd64f47..2adcce303271 100644 --- a/drivers/gpu/drm/i915/display/intel_crtc.c +++ b/drivers/gpu/drm/i915/display/intel_crtc.c @@ -389,8 +389,13 @@ int intel_crtc_init(struct drm_i915_private *dev_priv, enum pipe pipe) return ret; } -static bool intel_crtc_needs_vblank_work(const struct intel_crtc_state *crtc_state) +static bool intel_crtc_needs_vblank_work(const struct intel_atomic_state *state, +const struct intel_crtc_state *crtc_state) { + /* Always init for legacy cursor update, so we can sync on teardown */ + if (state->base.legacy_cursor_update) + return true; + return crtc_state->hw.active && !intel_crtc_needs_modeset(crtc_state) && !crtc_state->preload_luts && @@ -438,7 +443,7 @@ void intel_wait_for_vblank_workers(struct intel_atomic_state *state) int i; for_each_new_intel_crtc_in_state(state, crtc, crtc_state, i) { - if (!intel_crtc_needs_vblank_work(crtc_state)) + if (!intel_crtc_needs_vblank_work(state, crtc_state)) continue; drm_vblank_work_flush(_state->vblank_work); @@ -470,6 +475,7 @@ static int intel_mode_vblank_start(const struct drm_display_mode *mode) /** * intel_pipe_update_start() - start update of a set of display registers + * @state: the intel atomic state * @new_crtc_state: the new crtc state * * Mark the start of an update to pipe registers that should be updated @@ -480,7 +486,8 @@ static int intel_mode_vblank_start(const struct drm_display_mode *mode) * until a subsequent call to intel_pipe_update_end(). That is done to * avoid random delays. */ -void intel_pipe_update_start(struct intel_crtc_state *new_crtc_state) +void intel_pipe_update_start(struct intel_atomic_state *state, +struct intel_crtc_state *new_crtc_state) { struct intel_crtc *crtc = to_intel_crtc(new_crtc_state->uapi.crtc); struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); @@ -497,7 +504,7 @@ void intel_pipe_update_start(struct intel_crtc_state *new_crtc_state) if (new_crtc_state->do_async_flip) return; - if (intel_crtc_needs_vblank_work(new_crtc_state)) + if (intel_crtc_needs_vblank_work(state, new_crtc_state)) intel_crtc_vblank_work_init(new_crtc_state); if (new_crtc_state->vrr.enable) { @@ -631,13 +638,15 @@ static void dbg_vblank_evade(struct intel_crtc *crtc, ktime_t end) {} /** * intel_pipe_update_end() - end update of a set of display registers + * @state: the intel atomic state * @new_crtc_state: the new crtc state * * Mark the end of an update started with intel_pipe_update_start(). This * re-enables interrupts and verifies the update was actually completed * before a vblank. */ -void intel_pipe_update_end(struct intel_crtc_state *new_crtc_state) +void intel_pipe_update_end(struct intel_atomic_state *state, + struct intel_crtc_state *new_crtc_state) { struct intel_crtc *crtc = to_intel_crtc(new_crtc_state->uapi.crtc); enum pipe pipe = crtc->pipe; @@ -665,7 +674,7 @@ void intel_pipe_update_end(struct intel_crtc_state *new_crtc_state) * Would be slightly nice to just grab the vblank count and arm the * event outside of the critical section - the spinlock might spin for a * while ... */ - if (intel_crtc_needs_vblank_work(new_crtc_state)) { + if (intel_crtc_needs_vblank_work(state, new_crtc_state)) { drm_vblank_work_schedule(_crtc_state->vblank_work, drm_crtc_accurate_vblank_count(>base) + 1, false); diff --git a/drivers/gpu/drm/i915/display/intel_crtc.h b/drivers/gpu/drm/i915/display/intel_crtc.h index 51a4c8df9e65..ca7f45a454a0 100644 --- a/drivers/gpu/drm/i915/display/intel_crtc.h +++ b/drivers/gpu/drm/i915/display/intel_crtc.h @@ -36,8 +36,10 @@ void intel_crtc_state_reset(struct intel_crtc_state *crtc_state, u32 intel_crtc_get_vblank_counter(struct intel_crtc *crtc); void intel_crtc_vblank_on(const struct intel_crtc_state *crtc_state); void intel_crtc_vblank_off(const struct intel_crtc_state *crtc_state); -void intel_pipe_update_start(struct intel_crt
Re: [PATCH 16/17] cgroup/drm: Expose memory stats
Hey, On 2023-07-26 21:44, Tejun Heo wrote: Hello, On Wed, Jul 26, 2023 at 12:14:24PM +0200, Maarten Lankhorst wrote: So, yeah, if you want to add memory controls, we better think through how the fd ownership migration should work. I've taken a look at the series, since I have been working on cgroup memory eviction. The scheduling stuff will work for i915, since it has a purely software execlist scheduler, but I don't think it will work for GuC (firmware) scheduling or other drivers that use the generic drm scheduler. For something like this, you would probably want it to work inside the drm scheduler first. Presumably, this can be done by setting a weight on each runqueue, and perhaps adding a callback to update one for a running queue. Calculating the weights hierarchically might be fun.. I don't have any idea on this front. The basic idea of making high level distribution decisions in core code and letting individual drivers enforce that in a way which fits them the best makes sense to me but I don't know enough to have an opinion here. I have taken a look at how the rest of cgroup controllers change ownership when moved to a different cgroup, and the answer was: not at all. If we For persistent resources, that's the general rule. Whoever instantiates a resource gets to own it until the resource gets freed. There is an exception with the pid controller and there are discussions around whether we want some sort of migration behavior with memcg but yes by and large instantiator being the owner is the general model cgroup follows. attempt to create the scheduler controls only on the first time the fd is used, you could probably get rid of all the tracking. This can be done very easily with the drm scheduler. WRT memory, I think the consensus is to track system memory like normal memory. Stolen memory doesn't need to be tracked. It's kernel only memory, used for internal bookkeeping only. The only time userspace can directly manipulate stolen memory, is by mapping the pinned initial framebuffer to its own address space. The only allocation it can do is when a framebuffer is displayed, and framebuffer compression creates some stolen memory. Userspace is not aware of this though, and has no way to manipulate those contents. So, my dumb understanding: * Ownership of an fd can be established on the first ioctl call and doesn't need to be migrated afterwards. There are no persistent resources to migration on the first call. * Memory then can be tracked in a similar way to memcg. Memory gets charged to the initial instantiator and doesn't need to be moved around afterwards. There may be some discrepancies around stolen memory but the magnitude of inaccuracy introduced that way is limited and bound and can be safely ignored. Is that correct? Hey, Yeah mostly, I think we can stop tracking stolen memory. I stopped doing that for Xe, there is literally nothing to control for userspace in there. Cheers, Maarten
Re: [PATCH 16/17] cgroup/drm: Expose memory stats
Hey, On 2023-07-26 13:41, Tvrtko Ursulin wrote: On 26/07/2023 11:14, Maarten Lankhorst wrote: Hey, On 2023-07-22 00:21, Tejun Heo wrote: On Wed, Jul 12, 2023 at 12:46:04PM +0100, Tvrtko Ursulin wrote: $ cat drm.memory.stat card0 region=system total=12898304 shared=0 active=0 resident=12111872 purgeable=167936 card0 region=stolen-system total=0 shared=0 active=0 resident=0 purgeable=0 Data is generated on demand for simplicty of implementation ie. no running totals are kept or accounted during migrations and such. Various optimisations such as cheaper collection of data are possible but deliberately left out for now. Overall, the feature is deemed to be useful to container orchestration software (and manual management). Limits, either soft or hard, are not envisaged to be implemented on top of this approach due on demand nature of collecting the stats. So, yeah, if you want to add memory controls, we better think through how the fd ownership migration should work. I've taken a look at the series, since I have been working on cgroup memory eviction. The scheduling stuff will work for i915, since it has a purely software execlist scheduler, but I don't think it will work for GuC (firmware) scheduling or other drivers that use the generic drm scheduler. It actually works - I used to have a blurb in the cover letter about it but apparently I dropped it. Just a bit less well with many clients, since there are fewer priority levels. All that the design requires from the invididual drivers is some way to react to the "you are over budget by this much" signal. The rest is driver and backend specific. What I mean is that this signal may not be applicable since the drm scheduler just schedules jobs that run. Adding a weight might be done in hardware, since it's responsible for scheduling which context gets to run. The over budget signal is useless in that case, and you just need to set a scheduling priority for the hardware instead. For something like this, you would probably want it to work inside the drm scheduler first. Presumably, this can be done by setting a weight on each runqueue, and perhaps adding a callback to update one for a running queue. Calculating the weights hierarchically might be fun.. It is not needed to work in drm scheduler first. In fact drm scheduler based drivers can plug into what I have since it already has the notion of scheduling priorities. They would only need to implement a hook which allow the cgroup controller to query client GPU utilisation and another to received the over budget signal. Amdgpu and msm AFAIK could be easy candidates because they both support per client utilisation and priorities. Looks like I need to put all this info back into the cover letter. Also, hierarchic weights and time budgets are all already there. What could be done later is make this all smarter and respect the time budget with more precision. That would however, in many cases including Intel, require co-operation with the firmware. In any case it is only work in the implementation, while the cgroup control interface remains the same. I have taken a look at how the rest of cgroup controllers change ownership when moved to a different cgroup, and the answer was: not at all. If we attempt to create the scheduler controls only on the first time the fd is used, you could probably get rid of all the tracking. Can you send a CPU file descriptor from process A to process B and have CPU usage belonging to process B show up in process' A cgroup, or vice-versa? Nope, I am not making any sense, am I? My point being it is not like-to-like, model is different. No ownership transfer would mean in wide deployments all GPU utilisation would be assigned to Xorg and so there is no point to any of this. No way to throttle a cgroup with un-important GPU clients for instance. If you just grab the current process' cgroup when a drm_sched_entity is created, you don't have everything charged to X.org. No need for complicated ownership tracking in drm_file. The same equivalent should be done in i915 as well when a context is created as it's not using the drm scheduler. This can be done very easily with the drm scheduler. WRT memory, I think the consensus is to track system memory like normal memory. Stolen memory doesn't need to be tracked. It's kernel only memory, used for internal bookkeeping only. The only time userspace can directly manipulate stolen memory, is by mapping the pinned initial framebuffer to its own address space. The only allocation it can do is when a framebuffer is displayed, and framebuffer compression creates some stolen memory. Userspace is not aware of this though, and has no way to manipulate those contents. Stolen memory is irrelevant and not something cgroup controller knows about. Point is drivers say which memory regions they have and their utilisation. Imagine instead
Re: [PATCH 16/17] cgroup/drm: Expose memory stats
Hey, On 2023-07-22 00:21, Tejun Heo wrote: On Wed, Jul 12, 2023 at 12:46:04PM +0100, Tvrtko Ursulin wrote: $ cat drm.memory.stat card0 region=system total=12898304 shared=0 active=0 resident=12111872 purgeable=167936 card0 region=stolen-system total=0 shared=0 active=0 resident=0 purgeable=0 Data is generated on demand for simplicty of implementation ie. no running totals are kept or accounted during migrations and such. Various optimisations such as cheaper collection of data are possible but deliberately left out for now. Overall, the feature is deemed to be useful to container orchestration software (and manual management). Limits, either soft or hard, are not envisaged to be implemented on top of this approach due on demand nature of collecting the stats. So, yeah, if you want to add memory controls, we better think through how the fd ownership migration should work. I've taken a look at the series, since I have been working on cgroup memory eviction. The scheduling stuff will work for i915, since it has a purely software execlist scheduler, but I don't think it will work for GuC (firmware) scheduling or other drivers that use the generic drm scheduler. For something like this, you would probably want it to work inside the drm scheduler first. Presumably, this can be done by setting a weight on each runqueue, and perhaps adding a callback to update one for a running queue. Calculating the weights hierarchically might be fun.. I have taken a look at how the rest of cgroup controllers change ownership when moved to a different cgroup, and the answer was: not at all. If we attempt to create the scheduler controls only on the first time the fd is used, you could probably get rid of all the tracking. This can be done very easily with the drm scheduler. WRT memory, I think the consensus is to track system memory like normal memory. Stolen memory doesn't need to be tracked. It's kernel only memory, used for internal bookkeeping only. The only time userspace can directly manipulate stolen memory, is by mapping the pinned initial framebuffer to its own address space. The only allocation it can do is when a framebuffer is displayed, and framebuffer compression creates some stolen memory. Userspace is not aware of this though, and has no way to manipulate those contents. Cheers, ~Maarten
Re: [Intel-gfx] [drm-rerere] nightly.conf: drop sound tree from drm-tip altogether
Hey, Den 2023-07-06 kl. 11:28, skrev Jani Nikula: We used to have the sound branches be part of drm-tip to help development of DP and HDMI audio. However, we always used to run into problems with the sound branches merging Linus' master at non-tagged random commits, wreaking havoc especially during the merge windows. We only ever want to have tagged stuff merged back from Linus' tree to drm-tip. We introduced a mechanism in dim to hold back branches at certain commits, just to hold back sound branches when problems arise. We moved it along, but in the end nobody has updated this in literally years, and sound branches have been held back at v5.13. The merge window is currently open, and AFAICT the sound/for-linus branch again contains commits from the merge window. Let's just forget about the sound tree, as nobody has really missed it since v5.13, and focus on the drm branches. Signed-off-by: Jani Nikula Acked-by: Maarten Lankhorst --- nightly.conf | 7 --- 1 file changed, 7 deletions(-) diff --git a/nightly.conf b/nightly.conf index 73aec820e98f..c1e22800e276 100644 --- a/nightly.conf +++ b/nightly.conf @@ -46,11 +46,6 @@ git://anongit.freedesktop.org/drm/drm https://anongit.freedesktop.org/git/drm/drm https://anongit.freedesktop.org/git/drm/drm.git " -drm_tip_repos[sound-upstream]=" -git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git -https://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git -https://kernel.googlesource.com/pub/scm/linux/kernel/git/tiwai/sound.git -" drm_tip_repos[linux-upstream]=" git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git @@ -79,8 +74,6 @@ drm_tip_config=( "drm-intel drm-intel-next" "drm-intel drm-intel-gt-next" - "sound-upstream for-linus v5.13" - "sound-upstreamfor-nextv5.13" "drm-intel topic/core-for-CI" "drm-misc topic/i915-ttm" "drm topic/nouveau-misc"
[PULL] drm-misc-fixes
Hi Dave, Daniel, Midsummer is nearly here! So sending the pull request a bit early. Cheers! ~Maarten drm-misc-fixes-2023-06-21: drm-misc-fixes for v6.4: - Qaic imported dma-buf fix. - Fix null pointer deref when printing a dp-mst message. The following changes since commit 45a3e24f65e90a047bef86f927ebdc4c710edaa1: Linux 6.4-rc7 (2023-06-18 14:06:27 -0700) are available in the Git repository at: git://anongit.freedesktop.org/drm/drm-misc tags/drm-misc-fixes-2023-06-21 for you to fetch changes up to 54d217406afe250d7a768783baaa79a035f21d38: drm: use mgr->dev in drm_dbg_kms in drm_dp_add_payload_part2 (2023-06-20 16:00:09 -0400) drm-misc-fixes for v6.4: - Qaic imported dma-buf fix. - Fix null pointer deref when printing a dp-mst message. Jeff Layton (1): drm: use mgr->dev in drm_dbg_kms in drm_dp_add_payload_part2 Pranjal Ramajor Asha Kanojiya (1): accel/qaic: Call DRM helper function to destroy prime GEM drivers/accel/qaic/qaic_data.c| 4 ++-- drivers/gpu/drm/display/drm_dp_mst_topology.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-)
[PULL] drm-misc-fixes
Hey Dave, Daniel, Sorry for being late, life sometimes get in the way. Sometimes even literally! Cheers, ~Maarten drm-misc-fixes-2023-06-16: drm-misc-fixes maybe in time for v6.4-rc7: - qaic leak and null deref fix. - Fix runtime pm in nouveau. - Fix array overflow in ti-sn65dsi86 pwm chip handling. - Assorted null check fixes in nouveau. The following changes since commit a3efabee5878b8d7b1863debb78cb7129d07a346: accel/ivpu: Fix sporadic VPU boot failure (2023-06-08 08:17:27 +0200) are available in the Git repository at: git://anongit.freedesktop.org/drm/drm-misc tags/drm-misc-fixes-2023-06-16 for you to fetch changes up to 55b94bb8c42464bad3d2217f6874aa1a85664eac: drm/nouveau: add nv_encoder pointer check for NULL (2023-06-13 16:53:00 -0400) drm-misc-fixes maybe in time for v6.4-rc7: - qaic leak and null deref fix. - Fix runtime pm in nouveau. - Fix array overflow in ti-sn65dsi86 pwm chip handling. - Assorted null check fixes in nouveau. Carl Vanderlip (1): accel/qaic: Free user handle on interrupted mutex Jeffrey Hugo (1): accel/qaic: Fix NULL pointer deref in qaic_destroy_drm_device() Natalia Petrova (2): drm/nouveau/dp: check for NULL nv_connector->native_mode drm/nouveau: add nv_encoder pointer check for NULL Ratchanan Srirattanamet (1): drm/nouveau: don't detect DSM for non-NVIDIA device Su Hui (1): drm/bridge: ti-sn65dsi86: Avoid possible buffer overflow drivers/accel/qaic/qaic_drv.c | 4 drivers/gpu/drm/bridge/ti-sn65dsi86.c | 4 drivers/gpu/drm/nouveau/nouveau_acpi.c | 3 +++ drivers/gpu/drm/nouveau/nouveau_connector.c | 7 --- 4 files changed, 15 insertions(+), 3 deletions(-)
[PULL] drm-misc-fixes, try 2.
Hi Dave, Daniel, Same pull request, just verifying tooling works as intended now. :-) drm-misc-fixes for v6.4-rc6. Seems to be mostly small fixes, just a few more for ivpu. ~Maarten drm-misc-fixes-2023-06-08: drm-misc-fixes for v6.4-rc6: - resume and modeset fixes for ast. - Fill in fb-helper vars more correctly. - Assorted ivpu fixes. - lima context destroy fix. The following changes since commit e997c218ad736fd6f524d73a987bad9d94128d3d: accel/qaic: Fix NNC message corruption (2023-05-23 09:51:38 -0600) are available in the Git repository at: git://anongit.freedesktop.org/drm/drm-misc tags/drm-misc-fixes-2023-06-08 for you to fetch changes up to a3efabee5878b8d7b1863debb78cb7129d07a346: accel/ivpu: Fix sporadic VPU boot failure (2023-06-08 08:17:27 +0200) drm-misc-fixes for v6.4-rc6: - resume and modeset fixes for ast. - Fill in fb-helper vars more correctly. - Assorted ivpu fixes. - lima context destroy fix. Andrzej Kacprowski (2): accel/ivpu: Do not trigger extra VPU reset if the VPU is idle accel/ivpu: Fix sporadic VPU boot failure Erico Nunes (1): drm/lima: fix sched context destroy Geert Uytterhoeven (1): drm/fb-helper: Fix height, width, and accel_flags in fb_var Jammy Huang (2): drm/ast: Fix long time waiting on s3/s4 resume drm/ast: Fix modeset failed on DisplayPort Randy Dunlap (1): accel/ivpu: ivpu_ipc needs GENERIC_ALLOCATOR Stanislaw Gruszka (2): accel/ivpu: Reserve all non-command bo's using DMA_RESV_USAGE_BOOKKEEP accel/ivpu: Do not use mutex_lock_interruptible drivers/accel/ivpu/Kconfig | 1 + drivers/accel/ivpu/ivpu_hw_mtl.c | 22 +++ drivers/accel/ivpu/ivpu_hw_mtl_reg.h | 1 + drivers/accel/ivpu/ivpu_ipc.c| 4 +-- drivers/accel/ivpu/ivpu_job.c| 21 +- drivers/accel/ivpu/ivpu_mmu.c| 22 --- drivers/gpu/drm/ast/ast_dp.c | 55 +++- drivers/gpu/drm/ast/ast_drv.h| 5 +--- drivers/gpu/drm/ast/ast_main.c | 11 ++-- drivers/gpu/drm/ast/ast_mode.c | 15 -- drivers/gpu/drm/ast/ast_post.c | 3 +- drivers/gpu/drm/drm_fb_helper.c | 12 drivers/gpu/drm/lima/lima_sched.c| 2 +- 13 files changed, 90 insertions(+), 84 deletions(-)
Re: [PULL] drm-MISC-fixes
Hey, On 2023-06-08 10:50, Jani Nikula wrote: > On Thu, 08 Jun 2023, Maarten Lankhorst > wrote: >> Oops, forgot to fix topic. :-) > And replied to the wrong message. ;) > > But why was it wrong, not using dim? Gah! I was grabbing the tmp file used for the pull request from dim, but it doesn't recognise my MTA. As repentence, I will fix my tooling to generate the mail directly from dim, instead of carefully stealing the most recent pull request as new and filling in the contents. :-) Cheers, ~Maarten
[PULL] drm-MISC-fixes
Oops, forgot to fix topic. :-) On 2023-06-08 10:41, Joonas Lahtinen wrote: > Hi Dave & Daniel, > > Here's the drm-intel-fixes PR for v6.4-rc6. > > Couple of display compatibility fixes and two static checker fixes for > selftests. > > Regards, Joonas > > *** > > drm-intel-fixes-2023-06-08: > > CDCLK voltage fix for ADL-P and eDP wake sync pulse fix. > Two error handling fixes to selftests (to appease static checkers) > > The following changes since commit 9561de3a55bed6bdd44a12820ba81ec416e705a7: > > Linux 6.4-rc5 (2023-06-04 14:04:27 -0400) > > are available in the Git repository at: > > git://anongit.freedesktop.org/drm/drm-intel tags/drm-intel-fixes-2023-06-08 > > for you to fetch changes up to 79d0150d2d983a4f6efee676cea06027f586fcd0: > > drm/i915/selftests: Add some missing error propagation (2023-06-07 12:43:22 > +0300) > > > CDCLK voltage fix for ADL-P and eDP wake sync pulse fix. > Two error handling fixes to selftests (to appease static checkers) > > > Andi Shyti (1): > drm/i915/gt: Use the correct error value when kernel_context() fails > > Chaitanya Kumar Borah (1): > drm/i915/display: Set correct voltage level for 480MHz CDCLK > > Jouni Högander (1): > drm/i915: Use 18 fast wake AUX sync len > > Tvrtko Ursulin (1): > drm/i915/selftests: Add some missing error propagation > > drivers/gpu/drm/i915/display/intel_cdclk.c | 30 > +++--- > drivers/gpu/drm/i915/display/intel_dp_aux.c| 2 +- > .../gpu/drm/i915/gem/selftests/i915_gem_context.c | 14 +++--- > drivers/gpu/drm/i915/gt/selftest_execlists.c | 12 ++--- > 4 files changed, 45 insertions(+), 13 deletions(-)
[PULL] drm-intel-fixes
Hi Dave, Daniel, drm-misc-fixes for v6.4-rc6. Seems to be mostly small fixes, just a few more for ivpu. Cheers, ~Maarten drm-misc-fixes-2023-06-08: drm-misc-fixes for v6.4-rc6: - resume and modeset fixes for ast. - Fill in fb-helper vars more correctly. - Assorted ivpu fixes. - lima context destroy fix. The following changes since commit e997c218ad736fd6f524d73a987bad9d94128d3d: accel/qaic: Fix NNC message corruption (2023-05-23 09:51:38 -0600) are available in the Git repository at: git://anongit.freedesktop.org/drm/drm-misc tags/drm-misc-fixes-2023-06-08 for you to fetch changes up to a3efabee5878b8d7b1863debb78cb7129d07a346: accel/ivpu: Fix sporadic VPU boot failure (2023-06-08 08:17:27 +0200) drm-misc-fixes for v6.4-rc6: - resume and modeset fixes for ast. - Fill in fb-helper vars more correctly. - Assorted ivpu fixes. - lima context destroy fix. Andrzej Kacprowski (2): accel/ivpu: Do not trigger extra VPU reset if the VPU is idle accel/ivpu: Fix sporadic VPU boot failure Erico Nunes (1): drm/lima: fix sched context destroy Geert Uytterhoeven (1): drm/fb-helper: Fix height, width, and accel_flags in fb_var Jammy Huang (2): drm/ast: Fix long time waiting on s3/s4 resume drm/ast: Fix modeset failed on DisplayPort Randy Dunlap (1): accel/ivpu: ivpu_ipc needs GENERIC_ALLOCATOR Stanislaw Gruszka (2): accel/ivpu: Reserve all non-command bo's using DMA_RESV_USAGE_BOOKKEEP accel/ivpu: Do not use mutex_lock_interruptible drivers/accel/ivpu/Kconfig | 1 + drivers/accel/ivpu/ivpu_hw_mtl.c | 22 +++ drivers/accel/ivpu/ivpu_hw_mtl_reg.h | 1 + drivers/accel/ivpu/ivpu_ipc.c | 4 +-- drivers/accel/ivpu/ivpu_job.c | 21 +- drivers/accel/ivpu/ivpu_mmu.c | 22 --- drivers/gpu/drm/ast/ast_dp.c | 55 +++- drivers/gpu/drm/ast/ast_drv.h | 5 +--- drivers/gpu/drm/ast/ast_main.c | 11 ++-- drivers/gpu/drm/ast/ast_mode.c | 15 -- drivers/gpu/drm/ast/ast_post.c | 3 +- drivers/gpu/drm/drm_fb_helper.c | 12 drivers/gpu/drm/lima/lima_sched.c | 2 +- 13 files changed, 90 insertions(+), 84 deletions(-)
Re: [Intel-gfx] [RFC PATCH 0/4] Add support for DRM cgroup memory accounting.
Hey, On 2023-05-11 12:14, Tvrtko Ursulin wrote: > > On 10/05/2023 19:46, Tejun Heo wrote: >> Hello, >> >> On Wed, May 10, 2023 at 04:59:01PM +0200, Maarten Lankhorst wrote: >>> The misc controller is not granular enough. A single computer may have any >>> number of >>> graphics cards, some of them with multiple regions of vram inside a single >>> card. >> >> Extending the misc controller to support dynamic keys shouldn't be that >> difficult. >> >> ... >>> In the next version, I will move all the code for handling the resource >>> limit to >>> TTM's eviction layer, because otherwise it cannot handle the resource limit >>> correctly. >>> >>> The effect of moving the code to TTM, is that it will make the code even >>> more generic >>> for drivers that have vram and use TTM. When using TTM, you only have to >>> describe your >>> VRAM, update some fields in the TTM manager and (un)register your device >>> with the >>> cgroup handler on (un)load. It's quite trivial to add vram accounting to >>> amdgpu and >>> nouveau. [2] >>> >>> If you want to add a knob for scheduling weight for a process, it makes >>> sense to >>> also add resource usage as a knob, otherwise the effect of that knob is very >>> limited. So even for Tvrtko's original proposed usecase, it would make >>> sense. >> >> It does make sense but unlike Tvrtko's scheduling weights what's being >> proposed doesn't seem to encapsulate GPU memory resource in a generic enough >> manner at least to my untrained eyes. ie. w/ drm.weight, I don't need any >> specific knoweldge of how a specific GPU operates to say "this guy should >> get 2x processing power over that guy". This more or less holds for other >> major resources including CPU, memory and IO. What you're proposing seems a >> lot more tied to hardware details and users would have to know a lot more >> about how memory is configured on that particular GPU. >> >> Now, if this is inherent to how all, or at least most, GPUs operate, sure, >> but otherwise let's start small in terms of interface and not take up space >> which should be for something universal. If this turns out to be the way, >> expanding to take up the generic interface space isn't difficult. >> >> I don't know GPU space so please educate me where I'm wrong. > > I was hoping it might be passable in principle (in some form, pending > discussion on semantics) given how Maarten's proposal starts with only very > specific per-device-per-memory regions controls, which is applicable to many > devices. And hard limit at that, which probably has less complicated > semantics, or at least implementation. > > My understanding of the proposal is that the allocation either fits, or it > evicts from the parent's hierarchy (if possible) and then fits, or it fails. > Which sounds simple enough. Yeah, for vram itś that simple. I think for mapped and sysmem regions we may require the possiblity to ignore the limits as well, as it's possible to move to those regions from eviction. We probably don't want eviction to fail because of too low limits. > I do however agree that it is a limited use case. So from the negative side > of the debating camp I have to ask if this use case could be simply satisfied > by providing a driver/device global over commit yes/no control? In other > words, is it really important to partition the vram space ahead of time, and > from the kernel side too? Wouldn't the relevant (highly specialised) > applications work just fine with global over commit disabled? Even if the > option to configure their maximum allowed working set from the userspace side > was needed. Disabling overcommit? Do you mean pinning the memory workload? This causes a denial of service if done without limits, and that's what we're trying to avoid. There is no need for immunity from eviction. Overcommit is still useful inside the cgroup itself, we only want immunity from being evicted by another process performing another workload. > Or if we conclude cgroup controller is the way to go, would adding less > specific limits make it more palatable? I am thinking here some generic > "device memory resident". Not per device, not per memory region. So > userspace/admins have some chance of configuring generic limits. That would > require coming up with more generic use cases though so another thing to > discuss. Like who would use that and for what. You would run into ambiguity with that. I think it's fine to assume any number of vram regions. In most cases, the number is
[PULL] drm-misc-fixes
Hi Dave, Daniel, Next pull request, with the previous one included too: drm-misc-fixes-2023-05-11: drm-misc-fixes for v6.4-rc2: - More DSC macro fixes. - Small mipi-dsi fix. - Scheduler timeout handling fix. --- drm-misc-fixes for v6.4-rc1: - Fix DSC macros. - Fix VESA format for simplefb. - Prohibit potential out-of-bounds access in generic fbdev emulation. - Improve AST2500+ compat on ARM. The following changes since commit b63a553e8f5aa6574eeb535a551817a93c426d8c: drm/rockchip: vop2: Use regcache_sync() to fix suspend/resume (2023-04-17 23:40:40 +0200) are available in the Git repository at: git://anongit.freedesktop.org/drm/drm-misc tags/drm-misc-fixes-2023-05-11 for you to fetch changes up to 2da5bffe9eaa5819a868e8eaaa11b3fd0f16a691: drm/sched: Check scheduler work queue before calling timeout handling (2023-05-10 10:28:01 -0400) drm-misc-fixes for v6.4-rc2: - More DSC macro fixes. - Small mipi-dsi fix. - Scheduler timeout handling fix. --- drm-misc-fixes for v6.4-rc1: - Fix DSC macros. - Fix VESA format for simplefb. - Prohibit potential out-of-bounds access in generic fbdev emulation. - Improve AST2500+ compat on ARM. Jammy Huang (1): drm/ast: Fix ARM compatibility Jani Nikula (2): drm/dsc: fix drm_edp_dsc_sink_output_bpp() DPCD high byte usage drm/dsc: fix DP_DSC_MAX_BPP_DELTA_* macro values Kees Cook (1): drm/nouveau/disp: More DP_RECEIVER_CAP_SIZE array fixes Pierre Asselin (1): firmware/sysfb: Fix VESA format selection Saravana Kannan (1): drm/mipi-dsi: Set the fwnode for mipi_dsi_device Sui Jingfeng (1): drm/fbdev-generic: prohibit potential out-of-bounds access Vitaly Prosyak (1): drm/sched: Check scheduler work queue before calling timeout handling drivers/firmware/sysfb_simplefb.c| 4 +++- drivers/gpu/drm/ast/ast_main.c | 9 + drivers/gpu/drm/drm_fb_helper.c | 16 drivers/gpu/drm/drm_mipi_dsi.c | 2 +- drivers/gpu/drm/nouveau/include/nvif/if0012.h| 4 +++- drivers/gpu/drm/nouveau/nvkm/engine/disp/outp.h | 3 ++- drivers/gpu/drm/nouveau/nvkm/engine/disp/uoutp.c | 2 +- drivers/gpu/drm/scheduler/sched_main.c | 2 +- include/drm/display/drm_dp.h | 5 ++--- include/drm/display/drm_dp_helper.h | 5 ++--- 10 files changed, 32 insertions(+), 20 deletions(-) - On 2023-05-11 10:01, Thomas Zimmermann wrote: > A friendly ping to merge this PR. The patches appear to be missing from > drm-fixes. > > Am 26.04.23 um 07:59 schrieb Maarten Lankhorst: >> Hi Dave, Daniel, >> >> drm-misc-fixes pull request for rc1. drm-misc-next-fixes coming up.. next >> >> ~Maarten >> >> drm-misc-fixes-2023-04-26: >> drm-misc-fixes for v6.4-rc1: >> - Fix DSC macros. >> - Fix VESA format for simplefb. >> - Prohibit potential out-of-bounds access in generic fbdev emulation. >> - Improve AST2500+ compat on ARM. >> The following changes since commit b63a553e8f5aa6574eeb535a551817a93c426d8c: >> >> drm/rockchip: vop2: Use regcache_sync() to fix suspend/resume (2023-04-17 >> 23:40:40 +0200) >> >> are available in the Git repository at: >> >> git://anongit.freedesktop.org/drm/drm-misc tags/drm-misc-fixes-2023-04-26 >> >> for you to fetch changes up to 0d68683838f2850dd8ff31f1121e05bfb7a2def0: >> >> drm/dsc: fix DP_DSC_MAX_BPP_DELTA_* macro values (2023-04-24 22:40:57 >> +0300) >> >> >> drm-misc-fixes for v6.4-rc1: >> - Fix DSC macros. >> - Fix VESA format for simplefb. >> - Prohibit potential out-of-bounds access in generic fbdev emulation. >> - Improve AST2500+ compat on ARM. >> >> >> Jammy Huang (1): >> drm/ast: Fix ARM compatibility >> >> Jani Nikula (2): >> drm/dsc: fix drm_edp_dsc_sink_output_bpp() DPCD high byte usage >> drm/dsc: fix DP_DSC_MAX_BPP_DELTA_* macro values >> >> Pierre Asselin (1): >> firmware/sysfb: Fix VESA format selection >> >> Sui Jingfeng (1): >> drm/fbdev-generic: prohibit potential out-of-bounds access >> >> drivers/firmware/sysfb_simplefb.c | 4 +++- >> drivers/gpu/drm/ast/ast_main.c | 9 + >> drivers/gpu/drm/drm_fb_helper.c | 16 >> include/drm/display/drm_dp.h | 5 ++--- >> include/drm/display/drm_dp_helper.h | 5 ++--- >> 5 files changed, 24 insertions(+), 15 deletions(-) >> >> >
Re: [RFC PATCH 0/4] Add support for DRM cgroup memory accounting.
Hey, On 2023-05-10 20:46, Tejun Heo wrote: > Hello, > > On Wed, May 10, 2023 at 04:59:01PM +0200, Maarten Lankhorst wrote: >> The misc controller is not granular enough. A single computer may have any >> number of >> graphics cards, some of them with multiple regions of vram inside a single >> card. > Extending the misc controller to support dynamic keys shouldn't be that > difficult. > > ... >> In the next version, I will move all the code for handling the resource >> limit to >> TTM's eviction layer, because otherwise it cannot handle the resource limit >> correctly. >> >> The effect of moving the code to TTM, is that it will make the code even >> more generic >> for drivers that have vram and use TTM. When using TTM, you only have to >> describe your >> VRAM, update some fields in the TTM manager and (un)register your device >> with the >> cgroup handler on (un)load. It's quite trivial to add vram accounting to >> amdgpu and >> nouveau. [2] >> >> If you want to add a knob for scheduling weight for a process, it makes >> sense to >> also add resource usage as a knob, otherwise the effect of that knob is very >> limited. So even for Tvrtko's original proposed usecase, it would make sense. > It does make sense but unlike Tvrtko's scheduling weights what's being > proposed doesn't seem to encapsulate GPU memory resource in a generic enough > manner at least to my untrained eyes. ie. w/ drm.weight, I don't need any > specific knoweldge of how a specific GPU operates to say "this guy should > get 2x processing power over that guy". This more or less holds for other > major resources including CPU, memory and IO. What you're proposing seems a > lot more tied to hardware details and users would have to know a lot more > about how memory is configured on that particular GPU. There's not much need of knowing the specifics of a card, but there might be a need of knowing the workload to determine what allocation limits to set. I've left region to be implementation specific, but it would make sense to standardise it. TTM, the layer used by drivers that support VRAM, have the following regions: * sysmem - All system memory allocated; includes evicted VRAM. * mapped - All physical system memory that is mapped to the GPU, when unbound moves to sysmem. When evicting VRAM to sysmem, it's temporarily mapped here. * vramN - All VRAM regions of the device. * driver specific regions - probably doesn't make sense to put in cgroup at all, this includes stolen from the PoC. That leaves the question, what regions would make sense for a cgroup? Since vramN can be moved to mapped and sysmem (VRAM eviction, suspend/resume, driver_madvise), it becomes a subject of debate if we should include the other regions, since things become complicated fast. For the first iteration, I focus on a single category, vramN. Even when not knowing anything about a GPU, it will be easy to partition its memory like that. If you can assign a weight for the scheduler, then you can also partition it's vram by parsing /drm.capacity for total amount, and then splitting it across cgroups. > Now, if this is inherent to how all, or at least most, GPUs operate, sure, > but otherwise let's start small in terms of interface and not take up space > which should be for something universal. If this turns out to be the way, > expanding to take up the generic interface space isn't difficult. > > I don't know GPU space so please educate me where I'm wrong. Most GPU's have dedicated vram that works roughly in the same way, some integrated chips like i915 or arm use shared memory from the host system only. I would say amd, nvidia and intel's chips with dedicated memory work roughly in the same way for vram. I hope this explains it a little bit more, ~Maarten
Re: [RFC PATCH 0/4] Add support for DRM cgroup memory accounting.
Hey, On 2023-05-05 21:50, Tejun Heo wrote: Hello, On Wed, May 03, 2023 at 10:34:56AM +0200, Maarten Lankhorst wrote: RFC as I'm looking for comments. For long running compute, it can be beneficial to partition the GPU memory between cgroups, so each cgroup can use its maximum amount of memory without interfering with other scheduled jobs. Done properly, this can alleviate the need for eviction, which might result in a job being terminated if the GPU doesn't support mid-thread preemption or recoverable page faults. This is done by adding a bunch of knobs to cgroup: drm.capacity: Shows maximum capacity of each resource region. drm.max: Display or limit max amount of memory. drm.current: Current amount of memory in use. TTM has not been made cgroup aware yet, so instead of evicting from the current cgroup to stay within the cgroup limits, it simply returns the error -ENOSPC to userspace. I've used Tvrtko's cgroup controller series as a base, but it implemented scheduling weight, not memory accounting, so I only ended up keeping the base patch. Xe is not upstream yet, so the driver specific patch will only apply on https://gitlab.freedesktop.org/drm/xe/kernel Some high-level feedbacks. * There have been multiple attempts at this but the track record is kinda poor. People don't seem to agree what should constitute DRM memory and how they should be accounted / controlled. Thanks for the feedback. I think for a lot of drivers, what is VRAM might have different meaning, but the intention is it being accounted in the same way. Most drivers use TTM, which has a standard way of allocating memory, and a standard way of evicting VRAM. This makes it very useful for the usecase which I'm looking at, long running compute. When you have long running jobs, you don't want them to be interrupted because a completely unrelated process needs some VRAM, and one of the compute jobs buffers are being evicted. Some hardware does not support mid-thread preemption or page fault recovery, this means that when memory is evicted, the compute job is terminated. The full problem statement is in drm-compute.rst in the memory accounting patch. * I like Tvrtko's scheduling patchset because it exposes a generic interface which makes sense regardless of hardware details and then each driver can implement the configured control in whatever way they can. However, even for that, there doesn't seem much buy-in from other drivers. Yeah, that is correct. But it tries to solve a different part of the problem. * This proposal seems narrowly scoped trying to solve a specific problem which may not translate to different hardware configurations. Please let me know if I got that wrong, but if that's the case, I think a better and easier approach might be just being a part of the misc controller. That doesn't require much extra code and should be able to provide everything necessary for statically limiting specific resources. The misc controller is not granular enough. A single computer may have any number of graphics cards, some of them with multiple regions of vram inside a single card. For compute and shared hosting you might want to limit the usage of a single memory region on a single card, and then limit the same limits for the rest too, to prevent triggering eviction. The current version doesn't handle eviction correctly, because I was still working on it and I wanted to post a RFC. As a result, the case where resource limit is hit will evict the device's entire memory or get stuck in a loop. With some changes, the next version will not have this bug. This results in a few changes to the core code. [1] In the next version, I will move all the code for handling the resource limit to TTM's eviction layer, because otherwise it cannot handle the resource limit correctly. The effect of moving the code to TTM, is that it will make the code even more generic for drivers that have vram and use TTM. When using TTM, you only have to describe your VRAM, update some fields in the TTM manager and (un)register your device with the cgroup handler on (un)load. It's quite trivial to add vram accounting to amdgpu and nouveau. [2] If you want to add a knob for scheduling weight for a process, it makes sense to also add resource usage as a knob, otherwise the effect of that knob is very limited. So even for Tvrtko's original proposed usecase, it would make sense. Cheers, ~Maarten [1] Compared to this version: static inline int drmcg_try_charge(struct drmcgroup_state **drmcs, + struct drmcgroup_state **limitcs, struct drmcgroup_device *cgdev, u32 index, u64 size) This now returns which cgroup's limit is hit on -EAGAIN. +bool drmcs_grouped(struct drmcgroup_state *limitcs, + struct drmcgroup_state *testcs); Tells if testcs is the same as limitcs, or a subgroup
Re: [Intel-gfx] [RFC PATCH 2/4] drm/cgroup: Add memory accounting to DRM cgroup
I just now noticed the other comments. Wiill address them. On 2023-05-03 17:31, Tvrtko Ursulin wrote: On 03/05/2023 09:34, Maarten Lankhorst wrote: Based roughly on the rdma and misc cgroup controllers, with a lot of the accounting code borrowed from rdma. The interface is simple: - populate drmcgroup_device->regions[..] name and size for each active region. - Call drm(m)cg_register_device() - Use drmcg_try_charge to check if you can allocate a chunk of memory, use drmcg_uncharge when freeing it. This may return an error code, or -EAGAIN when the cgroup limit is reached. The ttm code transforms -EAGAIN back to -ENOSPC since it has specific logic for -ENOSPC, and returning -EAGAIN to userspace causes drmIoctl to restart infinitely. This API allows you to limit stuff with cgroups. You can see the supported cards in /sys/fs/cgroup/drm.capacity You need to echo +drm to cgroup.subtree_control, and then you can partition memory. In each cgroup subdir: drm.max shows the current limits of the cgroup. drm.current the current amount of allocated memory used by this cgroup. drm.events shows the amount of time max memory was reached. Events is not in the patch? Signed-off-by: Maarten Lankhorst --- Documentation/admin-guide/cgroup-v2.rst | 46 ++ Documentation/gpu/drm-compute.rst | 54 +++ include/linux/cgroup_drm.h | 81 kernel/cgroup/drm.c | 539 +++- 4 files changed, 699 insertions(+), 21 deletions(-) create mode 100644 Documentation/gpu/drm-compute.rst diff --git a/Documentation/admin-guide/cgroup-v2.rst b/Documentation/admin-guide/cgroup-v2.rst index f67c0829350b..b858d99cb2ef 100644 --- a/Documentation/admin-guide/cgroup-v2.rst +++ b/Documentation/admin-guide/cgroup-v2.rst @@ -2374,6 +2374,52 @@ RDMA Interface Files mlx4_0 hca_handle=1 hca_object=20 ocrdma1 hca_handle=1 hca_object=23 +DRM + + +The "drm" controller regulates the distribution and accounting of +DRM resources. + +DRM Interface Files + + + drm.max + A readwrite nested-keyed file that exists for all the cgroups + except root that describes current configured resource limit + for a DRM device. + + Lines are keyed by device name and are not ordered. + Each line contains space separated resource name and its configured + limit that can be distributed. + + The following nested keys are defined. + + == === + region.* Maximum amount of bytes that allocatable in this region + == === + + An example for xe follows:: + + :03:00.0 region.vram0=1073741824 region.stolen=max + + drm.capacity + A read-only file that describes maximum region capacity. + It only exists on the root cgroup. Not all memory can be + allocated by cgroups, as the kernel reserves some for + internal use. + + An example for xe follows:: + + :03:00.0 region.vram0=8514437120 region.stolen=67108864 + + drm.current + A read-only file that describes current resource usage. + It exists for all the cgroup except root. + + An example for xe follows:: + + :03:00.0 region.vram0=12550144 region.stolen=8650752 + HugeTLB --- diff --git a/Documentation/gpu/drm-compute.rst b/Documentation/gpu/drm-compute.rst new file mode 100644 index ..116270976ef7 --- /dev/null +++ b/Documentation/gpu/drm-compute.rst @@ -0,0 +1,54 @@ +== +Long running workloads and compute +== + +Long running workloads (compute) are workloads that will not complete in 10 +seconds. (The time let the user wait before he reaches for the power button). +This means that other techniques need to be used to manage those workloads, +that cannot use fences. + +Some hardware may schedule compute jobs, and have no way to pre-empt them, or +have their memory swapped out from them. Or they simply want their workload +not to be preempted or swapped out at all. + +This means that it differs from what is described in driver-api/dma-buf.rst. + +As with normal compute jobs, dma-fence may not be used at all. In this case, +not even to force preemption. The driver with is simply forced to unmap a BO +from the long compute job's address space on unbind immediately, not even +waiting for the workload to complete. Effectively this terminates the workload +when there is no hardware support to recover. + +Since this is undesirable, there need to be mitigations to prevent a workload +from being terminated. There are several possible approach, all with their +advantages and drawbacks. + +The first approach you will likely try is to pin all buffers used by compute. +This guarantees that the job will run uninterrupted, but also allows a very +denial of service attack by pinning as much memor
Re: [Intel-gfx] [RFC PATCH 2/4] drm/cgroup: Add memory accounting to DRM cgroup
On 2023-05-03 17:31, Tvrtko Ursulin wrote: On 03/05/2023 09:34, Maarten Lankhorst wrote: Based roughly on the rdma and misc cgroup controllers, with a lot of the accounting code borrowed from rdma. The interface is simple: - populate drmcgroup_device->regions[..] name and size for each active region. - Call drm(m)cg_register_device() - Use drmcg_try_charge to check if you can allocate a chunk of memory, use drmcg_uncharge when freeing it. This may return an error code, or -EAGAIN when the cgroup limit is reached. The ttm code transforms -EAGAIN back to -ENOSPC since it has specific logic for -ENOSPC, and returning -EAGAIN to userspace causes drmIoctl to restart infinitely. This API allows you to limit stuff with cgroups. You can see the supported cards in /sys/fs/cgroup/drm.capacity You need to echo +drm to cgroup.subtree_control, and then you can partition memory. In each cgroup subdir: drm.max shows the current limits of the cgroup. drm.current the current amount of allocated memory used by this cgroup. drm.events shows the amount of time max memory was reached. Events is not in the patch? Oops, correct. I removed it since it added more complexity, and didn't seem granular enough to be useful. I removed it from the documentation, but not the commit message it seems. :) Signed-off-by: Maarten Lankhorst --- Documentation/admin-guide/cgroup-v2.rst | 46 ++ Documentation/gpu/drm-compute.rst | 54 +++ include/linux/cgroup_drm.h | 81 kernel/cgroup/drm.c | 539 +++- 4 files changed, 699 insertions(+), 21 deletions(-) create mode 100644 Documentation/gpu/drm-compute.rst diff --git a/Documentation/admin-guide/cgroup-v2.rst b/Documentation/admin-guide/cgroup-v2.rst index f67c0829350b..b858d99cb2ef 100644 --- a/Documentation/admin-guide/cgroup-v2.rst +++ b/Documentation/admin-guide/cgroup-v2.rst @@ -2374,6 +2374,52 @@ RDMA Interface Files mlx4_0 hca_handle=1 hca_object=20 ocrdma1 hca_handle=1 hca_object=23 +DRM + + +The "drm" controller regulates the distribution and accounting of +DRM resources. + +DRM Interface Files + + + drm.max + A readwrite nested-keyed file that exists for all the cgroups + except root that describes current configured resource limit + for a DRM device. + + Lines are keyed by device name and are not ordered. + Each line contains space separated resource name and its configured + limit that can be distributed. + + The following nested keys are defined. + + == === + region.* Maximum amount of bytes that allocatable in this region + == === + + An example for xe follows:: + + :03:00.0 region.vram0=1073741824 region.stolen=max + + drm.capacity + A read-only file that describes maximum region capacity. + It only exists on the root cgroup. Not all memory can be + allocated by cgroups, as the kernel reserves some for + internal use. + + An example for xe follows:: + + :03:00.0 region.vram0=8514437120 region.stolen=67108864 + + drm.current + A read-only file that describes current resource usage. + It exists for all the cgroup except root. + + An example for xe follows:: + + :03:00.0 region.vram0=12550144 region.stolen=8650752 + HugeTLB --- diff --git a/Documentation/gpu/drm-compute.rst b/Documentation/gpu/drm-compute.rst new file mode 100644 index ..116270976ef7 --- /dev/null +++ b/Documentation/gpu/drm-compute.rst @@ -0,0 +1,54 @@ +== +Long running workloads and compute +== + +Long running workloads (compute) are workloads that will not complete in 10 +seconds. (The time let the user wait before he reaches for the power button). +This means that other techniques need to be used to manage those workloads, +that cannot use fences. + +Some hardware may schedule compute jobs, and have no way to pre-empt them, or +have their memory swapped out from them. Or they simply want their workload +not to be preempted or swapped out at all. + +This means that it differs from what is described in driver-api/dma-buf.rst. + +As with normal compute jobs, dma-fence may not be used at all. In this case, +not even to force preemption. The driver with is simply forced to unmap a BO +from the long compute job's address space on unbind immediately, not even +waiting for the workload to complete. Effectively this terminates the workload +when there is no hardware support to recover. + +Since this is undesirable, there need to be mitigations to prevent a workload +from being terminated. There are several possible approach, all with their +advantages and drawbacks. + +The first approach you will likely try is to pin all buffers use
Re: [Intel-xe] [RFC PATCH 3/4] drm/ttm: Handle -EAGAIN in ttm_resource_alloc as -ENOSPC.
On 2023-05-03 11:11, Thomas Hellström wrote: Hi, Maarten On 5/3/23 10:34, Maarten Lankhorst wrote: This allows the drm cgroup controller to return no space is available.. XXX: This is a hopeless simplification that changes behavior, and returns -ENOSPC even if we could evict ourselves from the current cgroup. Ideally, the eviction code becomes cgroup aware, and will force eviction from the current cgroup or its parents. Signed-off-by: Maarten Lankhorst Thinking of the shrinker analogy, do non-cgroup aware shrinkers just shrink blindly or do they reject shrinking like this patch when a cgroup limit is reached? When I made the cgroup controller return -ENOSPC I just hit an infinite loop since it sees enough memory is free and tries to allocate memory again. Hence the -EAGAIN handling here. It returns -ENOSPC, without the infinite looping. I think there should be 2 code paths: - OOM, generic case: Handle like we do now. No need for special cgroup handling needed right now. Might change if we implement cgroup memory semantics. See the memory section of Documentation/admin-guide/cgroup-v2.rst It could be useful regardless. - OOM, cgroup limit reached: Check for each BO if it's valuable to evict to unblock the relevant limit. / cg1.0 root - cg1 -- cg1.1 \ \ cg1.2 \ cg2 If we hit the cg limit in cg1.0 for only cg1.0, it doesn't make sense to evict from any other cgroup. If we hit the limit in cg1.0 for the entirety of cg1, it makes sense to evict from any of the cg1 nodes, but not from cg2. This should be relatively straightforward to implement. We identify which cgroup hit a limit, and then let the shrinker run only on that cgroup and its childs. This could be simplified to the OOM generic case, for root/NULL cg. ~Maarten
[RFC PATCH 4/4] drm/xe: Add support for the drm cgroup
Add some code to implement basic support for the vram0, vram1 and stolen memory regions. I fear the try_charge code should probably be done inside TTM. This code should interact with the shrinker, but for a simple RFC it's good enough. Signed-off-by: Maarten Lankhorst --- drivers/gpu/drm/xe/xe_device.c | 4 drivers/gpu/drm/xe/xe_device_types.h | 4 drivers/gpu/drm/xe/xe_ttm_vram_mgr.c | 21 +++-- drivers/gpu/drm/xe/xe_ttm_vram_mgr_types.h | 5 + 4 files changed, 32 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/xe/xe_device.c b/drivers/gpu/drm/xe/xe_device.c index 45d6e5ff47fd..f0a5af15a662 100644 --- a/drivers/gpu/drm/xe/xe_device.c +++ b/drivers/gpu/drm/xe/xe_device.c @@ -291,6 +291,10 @@ int xe_device_probe(struct xe_device *xe) /* Allocate and map stolen after potential VRAM resize */ xe_ttm_stolen_mgr_init(xe); + err = drmmcg_register_device(>drm, >cg); + if (err) + goto err_irq_shutdown; + /* * Now that GT is initialized (TTM in particular), * we can try to init display, and inherit the initial fb. diff --git a/drivers/gpu/drm/xe/xe_device_types.h b/drivers/gpu/drm/xe/xe_device_types.h index 1cb404e48aaa..04b85060cbec 100644 --- a/drivers/gpu/drm/xe/xe_device_types.h +++ b/drivers/gpu/drm/xe/xe_device_types.h @@ -12,6 +12,8 @@ #include #include +#include + #include "xe_gt_types.h" #include "xe_platform_types.h" #include "xe_step_types.h" @@ -55,6 +57,8 @@ struct xe_device { /** @drm: drm device */ struct drm_device drm; + struct drmcgroup_device cg; + /** @info: device info */ struct intel_device_info { /** @graphics_name: graphics IP name */ diff --git a/drivers/gpu/drm/xe/xe_ttm_vram_mgr.c b/drivers/gpu/drm/xe/xe_ttm_vram_mgr.c index 73836b9b7fed..263cd4ef7b6d 100644 --- a/drivers/gpu/drm/xe/xe_ttm_vram_mgr.c +++ b/drivers/gpu/drm/xe/xe_ttm_vram_mgr.c @@ -50,6 +50,7 @@ static int xe_ttm_vram_mgr_new(struct ttm_resource_manager *man, struct ttm_resource **res) { struct xe_ttm_vram_mgr *mgr = to_xe_ttm_vram_mgr(man); + struct xe_device *xe = ttm_to_xe_device(tbo->bdev); struct xe_ttm_vram_mgr_resource *vres; struct drm_buddy *mm = >mm; u64 size, remaining_size, min_page_size; @@ -116,9 +117,8 @@ static int xe_ttm_vram_mgr_new(struct ttm_resource_manager *man, mutex_lock(>lock); if (lpfn <= mgr->visible_size >> PAGE_SHIFT && size > mgr->visible_avail) { - mutex_unlock(>lock); err = -ENOSPC; - goto error_fini; + goto error_unlock; } if (place->fpfn + (size >> PAGE_SHIFT) != place->lpfn && @@ -129,6 +129,10 @@ static int xe_ttm_vram_mgr_new(struct ttm_resource_manager *man, lpfn = max_t(unsigned long, place->fpfn + (size >> PAGE_SHIFT), lpfn); } + err = drmcg_try_charge(>cg, >cg, mgr->mem_type, vres->base.size); + if (err) + goto error_unlock; + remaining_size = size; do { /* @@ -197,6 +201,8 @@ static int xe_ttm_vram_mgr_new(struct ttm_resource_manager *man, error_free_blocks: drm_buddy_free_list(mm, >blocks); + drmcg_uncharge(vres->cg, >cg, mgr->mem_type, vres->base.size); +error_unlock: mutex_unlock(>lock); error_fini: ttm_resource_fini(man, >base); @@ -211,6 +217,7 @@ static void xe_ttm_vram_mgr_del(struct ttm_resource_manager *man, struct xe_ttm_vram_mgr_resource *vres = to_xe_ttm_vram_mgr_resource(res); struct xe_ttm_vram_mgr *mgr = to_xe_ttm_vram_mgr(man); + struct xe_device *xe = ttm_to_xe_device(man->bdev); struct drm_buddy *mm = >mm; mutex_lock(>lock); @@ -218,6 +225,7 @@ static void xe_ttm_vram_mgr_del(struct ttm_resource_manager *man, mgr->visible_avail += vres->used_visible_size; mutex_unlock(>lock); + drmcg_uncharge(vres->cg, >cg, mgr->mem_type, vres->base.size); ttm_resource_fini(man, res); kfree(vres); @@ -337,6 +345,15 @@ int __xe_ttm_vram_mgr_init(struct xe_device *xe, struct xe_ttm_vram_mgr *mgr, struct ttm_resource_manager *man = >manager; int err; + xe->cg.regions[mem_type].size = size; + + if (mem_type == XE_PL_STOLEN) { + xe->cg.regions[mem_type].name = "stolen"; + } else { + xe->cg.regions[mem_type].name = + mem_type == XE_PL_VRAM0 ? "vram0" : "vram1"; + } + man->func = _ttm_vram_mgr_func; mgr->mem_type = mem_type; mutex_init(>lock); diff --git a/drivers/g
[RFC PATCH 2/4] drm/cgroup: Add memory accounting to DRM cgroup
Based roughly on the rdma and misc cgroup controllers, with a lot of the accounting code borrowed from rdma. The interface is simple: - populate drmcgroup_device->regions[..] name and size for each active region. - Call drm(m)cg_register_device() - Use drmcg_try_charge to check if you can allocate a chunk of memory, use drmcg_uncharge when freeing it. This may return an error code, or -EAGAIN when the cgroup limit is reached. The ttm code transforms -EAGAIN back to -ENOSPC since it has specific logic for -ENOSPC, and returning -EAGAIN to userspace causes drmIoctl to restart infinitely. This API allows you to limit stuff with cgroups. You can see the supported cards in /sys/fs/cgroup/drm.capacity You need to echo +drm to cgroup.subtree_control, and then you can partition memory. In each cgroup subdir: drm.max shows the current limits of the cgroup. drm.current the current amount of allocated memory used by this cgroup. drm.events shows the amount of time max memory was reached. Signed-off-by: Maarten Lankhorst --- Documentation/admin-guide/cgroup-v2.rst | 46 ++ Documentation/gpu/drm-compute.rst | 54 +++ include/linux/cgroup_drm.h | 81 kernel/cgroup/drm.c | 539 +++- 4 files changed, 699 insertions(+), 21 deletions(-) create mode 100644 Documentation/gpu/drm-compute.rst diff --git a/Documentation/admin-guide/cgroup-v2.rst b/Documentation/admin-guide/cgroup-v2.rst index f67c0829350b..b858d99cb2ef 100644 --- a/Documentation/admin-guide/cgroup-v2.rst +++ b/Documentation/admin-guide/cgroup-v2.rst @@ -2374,6 +2374,52 @@ RDMA Interface Files mlx4_0 hca_handle=1 hca_object=20 ocrdma1 hca_handle=1 hca_object=23 +DRM + + +The "drm" controller regulates the distribution and accounting of +DRM resources. + +DRM Interface Files + + + drm.max + A readwrite nested-keyed file that exists for all the cgroups + except root that describes current configured resource limit + for a DRM device. + + Lines are keyed by device name and are not ordered. + Each line contains space separated resource name and its configured + limit that can be distributed. + + The following nested keys are defined. + + ===== + region.* Maximum amount of bytes that allocatable in this region + ===== + + An example for xe follows:: + + :03:00.0 region.vram0=1073741824 region.stolen=max + + drm.capacity + A read-only file that describes maximum region capacity. + It only exists on the root cgroup. Not all memory can be + allocated by cgroups, as the kernel reserves some for + internal use. + + An example for xe follows:: + + :03:00.0 region.vram0=8514437120 region.stolen=67108864 + + drm.current + A read-only file that describes current resource usage. + It exists for all the cgroup except root. + + An example for xe follows:: + + :03:00.0 region.vram0=12550144 region.stolen=8650752 + HugeTLB --- diff --git a/Documentation/gpu/drm-compute.rst b/Documentation/gpu/drm-compute.rst new file mode 100644 index ..116270976ef7 --- /dev/null +++ b/Documentation/gpu/drm-compute.rst @@ -0,0 +1,54 @@ +== +Long running workloads and compute +== + +Long running workloads (compute) are workloads that will not complete in 10 +seconds. (The time let the user wait before he reaches for the power button). +This means that other techniques need to be used to manage those workloads, +that cannot use fences. + +Some hardware may schedule compute jobs, and have no way to pre-empt them, or +have their memory swapped out from them. Or they simply want their workload +not to be preempted or swapped out at all. + +This means that it differs from what is described in driver-api/dma-buf.rst. + +As with normal compute jobs, dma-fence may not be used at all. In this case, +not even to force preemption. The driver with is simply forced to unmap a BO +from the long compute job's address space on unbind immediately, not even +waiting for the workload to complete. Effectively this terminates the workload +when there is no hardware support to recover. + +Since this is undesirable, there need to be mitigations to prevent a workload +from being terminated. There are several possible approach, all with their +advantages and drawbacks. + +The first approach you will likely try is to pin all buffers used by compute. +This guarantees that the job will run uninterrupted, but also allows a very +denial of service attack by pinning as much memory as possible, hogging the +all GPU memory, and possibly a huge chunk of CPU memory. + +A second approach that will work slightly bett
[RFC PATCH 3/4] drm/ttm: Handle -EAGAIN in ttm_resource_alloc as -ENOSPC.
This allows the drm cgroup controller to return no space is available.. XXX: This is a hopeless simplification that changes behavior, and returns -ENOSPC even if we could evict ourselves from the current cgroup. Ideally, the eviction code becomes cgroup aware, and will force eviction from the current cgroup or its parents. Signed-off-by: Maarten Lankhorst --- drivers/gpu/drm/ttm/ttm_bo.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c index bd5dae4d1624..e057d5d8f09a 100644 --- a/drivers/gpu/drm/ttm/ttm_bo.c +++ b/drivers/gpu/drm/ttm/ttm_bo.c @@ -731,6 +731,8 @@ static int ttm_bo_mem_force_space(struct ttm_buffer_object *bo, ret = ttm_resource_alloc(bo, place, mem); if (likely(!ret)) break; + if (ret == -EAGAIN) + return -ENOSPC; if (unlikely(ret != -ENOSPC)) return ret; ret = ttm_mem_evict_first(bdev, man, place, ctx, @@ -783,7 +785,7 @@ int ttm_bo_mem_space(struct ttm_buffer_object *bo, type_found = true; ret = ttm_resource_alloc(bo, place, mem); - if (ret == -ENOSPC) + if (ret == -ENOSPC || ret == -EAGAIN) continue; if (unlikely(ret)) goto error; -- 2.34.1
[RFC PATCH 1/4] cgroup: Add the DRM cgroup controller
From: Tvrtko Ursulin Skeleton controller without any functionality. Signed-off-by: Tvrtko Ursulin Signed-off-by: Maarten Lankhorst --- include/linux/cgroup_drm.h| 9 ++ include/linux/cgroup_subsys.h | 4 +++ init/Kconfig | 7 kernel/cgroup/Makefile| 1 + kernel/cgroup/drm.c | 60 +++ 5 files changed, 81 insertions(+) create mode 100644 include/linux/cgroup_drm.h create mode 100644 kernel/cgroup/drm.c diff --git a/include/linux/cgroup_drm.h b/include/linux/cgroup_drm.h new file mode 100644 index ..8ef66a47619f --- /dev/null +++ b/include/linux/cgroup_drm.h @@ -0,0 +1,9 @@ +/* SPDX-License-Identifier: MIT */ +/* + * Copyright © 2023 Intel Corporation + */ + +#ifndef _CGROUP_DRM_H +#define _CGROUP_DRM_H + +#endif /* _CGROUP_DRM_H */ diff --git a/include/linux/cgroup_subsys.h b/include/linux/cgroup_subsys.h index 445235487230..49460494a010 100644 --- a/include/linux/cgroup_subsys.h +++ b/include/linux/cgroup_subsys.h @@ -65,6 +65,10 @@ SUBSYS(rdma) SUBSYS(misc) #endif +#if IS_ENABLED(CONFIG_CGROUP_DRM) +SUBSYS(drm) +#endif + /* * The following subsystems are not supported on the default hierarchy. */ diff --git a/init/Kconfig b/init/Kconfig index 1fb5f313d18f..1679229143c0 100644 --- a/init/Kconfig +++ b/init/Kconfig @@ -1093,6 +1093,13 @@ config CGROUP_RDMA Attaching processes with active RDMA resources to the cgroup hierarchy is allowed even if can cross the hierarchy's limit. +config CGROUP_DRM + bool "DRM controller" + help + Provides the DRM subsystem controller. + + ... + config CGROUP_FREEZER bool "Freezer controller" help diff --git a/kernel/cgroup/Makefile b/kernel/cgroup/Makefile index 12f8457ad1f9..849bd2917477 100644 --- a/kernel/cgroup/Makefile +++ b/kernel/cgroup/Makefile @@ -6,4 +6,5 @@ obj-$(CONFIG_CGROUP_PIDS) += pids.o obj-$(CONFIG_CGROUP_RDMA) += rdma.o obj-$(CONFIG_CPUSETS) += cpuset.o obj-$(CONFIG_CGROUP_MISC) += misc.o +obj-$(CONFIG_CGROUP_DRM) += drm.o obj-$(CONFIG_CGROUP_DEBUG) += debug.o diff --git a/kernel/cgroup/drm.c b/kernel/cgroup/drm.c new file mode 100644 index ..02c8eaa633d3 --- /dev/null +++ b/kernel/cgroup/drm.c @@ -0,0 +1,60 @@ +/* SPDX-License-Identifier: MIT */ +/* + * Copyright © 2023 Intel Corporation + */ + +#include +#include +#include + +struct drm_cgroup_state { + struct cgroup_subsys_state css; +}; + +struct drm_root_cgroup_state { + struct drm_cgroup_state drmcs; +}; + +static struct drm_root_cgroup_state root_drmcs; + +static inline struct drm_cgroup_state * +css_to_drmcs(struct cgroup_subsys_state *css) +{ + return container_of(css, struct drm_cgroup_state, css); +} + +static void drmcs_free(struct cgroup_subsys_state *css) +{ + struct drm_cgroup_state *drmcs = css_to_drmcs(css); + + if (drmcs != _drmcs.drmcs) + kfree(drmcs); +} + +static struct cgroup_subsys_state * +drmcs_alloc(struct cgroup_subsys_state *parent_css) +{ + struct drm_cgroup_state *drmcs; + + if (!parent_css) { + drmcs = _drmcs.drmcs; + } else { + drmcs = kzalloc(sizeof(*drmcs), GFP_KERNEL); + if (!drmcs) + return ERR_PTR(-ENOMEM); + } + + return >css; +} + +struct cftype files[] = { + { } /* Zero entry terminates. */ +}; + +struct cgroup_subsys drm_cgrp_subsys = { + .css_alloc = drmcs_alloc, + .css_free = drmcs_free, + .early_init = false, + .legacy_cftypes = files, + .dfl_cftypes= files, +}; -- 2.34.1
[RFC PATCH 0/4] Add support for DRM cgroup memory accounting.
RFC as I'm looking for comments. For long running compute, it can be beneficial to partition the GPU memory between cgroups, so each cgroup can use its maximum amount of memory without interfering with other scheduled jobs. Done properly, this can alleviate the need for eviction, which might result in a job being terminated if the GPU doesn't support mid-thread preemption or recoverable page faults. This is done by adding a bunch of knobs to cgroup: drm.capacity: Shows maximum capacity of each resource region. drm.max: Display or limit max amount of memory. drm.current: Current amount of memory in use. TTM has not been made cgroup aware yet, so instead of evicting from the current cgroup to stay within the cgroup limits, it simply returns the error -ENOSPC to userspace. I've used Tvrtko's cgroup controller series as a base, but it implemented scheduling weight, not memory accounting, so I only ended up keeping the base patch. Xe is not upstream yet, so the driver specific patch will only apply on https://gitlab.freedesktop.org/drm/xe/kernel Maarten Lankhorst (3): drm/cgroup: Add memory accounting to DRM cgroup drm/ttm: Handle -EAGAIN in ttm_resource_alloc as -ENOSPC. drm/xe: Add support for the drm cgroup Tvrtko Ursulin (1): cgroup: Add the DRM cgroup controller Documentation/admin-guide/cgroup-v2.rst| 46 ++ Documentation/gpu/drm-compute.rst | 54 ++ drivers/gpu/drm/ttm/ttm_bo.c | 4 +- drivers/gpu/drm/xe/xe_device.c | 4 + drivers/gpu/drm/xe/xe_device_types.h | 4 + drivers/gpu/drm/xe/xe_ttm_vram_mgr.c | 21 +- drivers/gpu/drm/xe/xe_ttm_vram_mgr_types.h | 5 + include/linux/cgroup_drm.h | 90 include/linux/cgroup_subsys.h | 4 + init/Kconfig | 7 + kernel/cgroup/Makefile | 1 + kernel/cgroup/drm.c| 557 + 12 files changed, 794 insertions(+), 3 deletions(-) create mode 100644 Documentation/gpu/drm-compute.rst create mode 100644 include/linux/cgroup_drm.h create mode 100644 kernel/cgroup/drm.c -- 2.34.1
[PULL] drm-misc-next-fixes
Hey Dave, Daniel, Complementary pull request for drm-misc-next-fixes! ~Maarten drm-misc-next-fixes-2023-04-26: drm-misc-next-fixes for v6.4-rc1: - Revert uAPI from accel/qaic. - Fix TTM build on archs where PMD_SHIFT is not constant. - Improve error handling in nt35950. - Fix double unregister in otm8009a when removing the driver. The following changes since commit d8dab40a8b37fe8207e1edf68205c709b477e0a4: Merge tag 'drm-misc-next-2023-04-12' of git://anongit.freedesktop.org/drm/drm-misc into drm-next (2023-04-12 16:23:04 +0200) are available in the Git repository at: git://anongit.freedesktop.org/drm/drm-misc tags/drm-misc-next-fixes-2023-04-26 for you to fetch changes up to a50be876f4fe2349dc8b056a49d87f69c944570f: drm/panel: novatek-nt35950: Only unregister DSI1 if it exists (2023-04-18 10:20:26 +0200) drm-misc-next-fixes for v6.4-rc1: - Revert uAPI from accel/qaic. - Fix TTM build on archs where PMD_SHIFT is not constant. - Improve error handling in nt35950. - Fix double unregister in otm8009a when removing the driver. Christian König (1): drm/ttm: revert "Reduce the number of used allocation orders for TTM pages" James Cowgill (1): drm/panel: otm8009a: Set backlight parent to panel device Jeffrey Hugo (1): Revert "accel/qaic: Add mhi_qaic_cntl" Konrad Dybcio (2): drm/panel: novatek-nt35950: Improve error handling drm/panel: novatek-nt35950: Only unregister DSI1 if it exists drivers/accel/qaic/Makefile | 1 - drivers/accel/qaic/mhi_qaic_ctrl.c | 569 --- drivers/accel/qaic/mhi_qaic_ctrl.h | 12 - drivers/accel/qaic/qaic_drv.c | 10 - drivers/gpu/drm/panel/panel-novatek-nt35950.c | 10 +- drivers/gpu/drm/panel/panel-orisetech-otm8009a.c | 2 +- drivers/gpu/drm/ttm/ttm_pool.c | 30 +- 7 files changed, 21 insertions(+), 613 deletions(-) delete mode 100644 drivers/accel/qaic/mhi_qaic_ctrl.c delete mode 100644 drivers/accel/qaic/mhi_qaic_ctrl.h
[PULL] drm-misc-fixes
Hi Dave, Daniel, drm-misc-fixes pull request for rc1. drm-misc-next-fixes coming up.. next ~Maarten drm-misc-fixes-2023-04-26: drm-misc-fixes for v6.4-rc1: - Fix DSC macros. - Fix VESA format for simplefb. - Prohibit potential out-of-bounds access in generic fbdev emulation. - Improve AST2500+ compat on ARM. The following changes since commit b63a553e8f5aa6574eeb535a551817a93c426d8c: drm/rockchip: vop2: Use regcache_sync() to fix suspend/resume (2023-04-17 23:40:40 +0200) are available in the Git repository at: git://anongit.freedesktop.org/drm/drm-misc tags/drm-misc-fixes-2023-04-26 for you to fetch changes up to 0d68683838f2850dd8ff31f1121e05bfb7a2def0: drm/dsc: fix DP_DSC_MAX_BPP_DELTA_* macro values (2023-04-24 22:40:57 +0300) drm-misc-fixes for v6.4-rc1: - Fix DSC macros. - Fix VESA format for simplefb. - Prohibit potential out-of-bounds access in generic fbdev emulation. - Improve AST2500+ compat on ARM. Jammy Huang (1): drm/ast: Fix ARM compatibility Jani Nikula (2): drm/dsc: fix drm_edp_dsc_sink_output_bpp() DPCD high byte usage drm/dsc: fix DP_DSC_MAX_BPP_DELTA_* macro values Pierre Asselin (1): firmware/sysfb: Fix VESA format selection Sui Jingfeng (1): drm/fbdev-generic: prohibit potential out-of-bounds access drivers/firmware/sysfb_simplefb.c | 4 +++- drivers/gpu/drm/ast/ast_main.c | 9 + drivers/gpu/drm/drm_fb_helper.c | 16 include/drm/display/drm_dp.h | 5 ++--- include/drm/display/drm_dp_helper.h | 5 ++--- 5 files changed, 24 insertions(+), 15 deletions(-)
[PULL] drm-misc-next
Good afternoon Daniel, Dave, One last pull request for drm-misc-next. Small one, so easy to merge. As a result also more likely to eat your computer alive. ;) Cheers, ~Maarten drm-misc-next-2023-04-12: drm-misc-next for v6.4-rc1: Cross-subsystem Changes: - Convert MIPI DSIM bridge to yaml. Core Changes: - Fix UAF race in drm scheduler. Driver Changes: - Add primary plane positioning support to VKMS. - Convert omapdrm fbdev emulation to in-kernel client. - Assorted small fixes to vkms, vc4, nouveau, vmwgfx. The following changes since commit e44f18c6ff8beef7b2b10592287f0a9766376d9b: drm/ttm: Make the call to ttm_tt_populate() interruptible when faulting (2023-04-06 10:01:42 +0200) are available in the Git repository at: git://anongit.freedesktop.org/drm/drm-misc tags/drm-misc-next-2023-04-12 for you to fetch changes up to fd35174e13f98f9232c4aa66689816731d34ca28: drm/vmwgfx: remove unused vmw_overlay function (2023-04-11 13:48:55 -0400) drm-misc-next for v6.4-rc1: Cross-subsystem Changes: - Convert MIPI DSIM bridge to yaml. Core Changes: - Fix UAF race in drm scheduler. Driver Changes: - Add primary plane positioning support to VKMS. - Convert omapdrm fbdev emulation to in-kernel client. - Assorted small fixes to vkms, vc4, nouveau, vmwgfx. Asahi Lina (1): drm/scheduler: Fix UAF race in drm_sched_entity_push_job() Ben Dooks (1): drm/nouveau/mc/ga100: make ga100_mc_device static Jagan Teki (1): dt-bindings: bridge: Convert Samsung MIPI DSIM bridge to yaml Javier Martinez Canillas (2): drm/vkms: Drop vkms_connector_destroy() wrapper drm/vkms: Remove include Martin Krastev (2): drm/vmwgfx: Drop mksstat_init_record fn as currently unused drm/vmwgfx: Fix Legacy Display Unit atomic drm support Maíra Canal (2): drm/vkms: remove the need for the primary plane to be visible drm/vkms: allow the primary plane to be positioned Thomas Zimmermann (5): drm/omapdrm: Include drm/omapdrm: Remove fb from struct omap_fbdev drm/omapdrm: Remove bo from struct omap_fbdev drm/omapdrm: Remove fbdev from struct omap_drm_private drm/omapdrm: Implement fbdev emulation as in-kernel client Tom Rix (2): drm/vc4: remove unused render_wait variable drm/vmwgfx: remove unused vmw_overlay function Zack Rusin (1): drm/vmwgfx: Print errors when running on broken/unsupported configs ruanjinjie (1): drm/nouveau/disp: make gv100_disp_core_mthd_base static .../bindings/display/bridge/samsung,mipi-dsim.yaml | 255 + .../bindings/display/exynos/exynos_dsim.txt | 92 MAINTAINERS | 1 + drivers/gpu/drm/nouveau/nvkm/engine/disp/gv100.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/mc/ga100.c | 2 +- drivers/gpu/drm/omapdrm/omap_debugfs.c | 6 +- drivers/gpu/drm/omapdrm/omap_drv.c | 13 +- drivers/gpu/drm/omapdrm/omap_drv.h | 3 - drivers/gpu/drm/omapdrm/omap_fbdev.c | 163 - drivers/gpu/drm/omapdrm/omap_fbdev.h | 9 +- drivers/gpu/drm/scheduler/sched_entity.c | 11 +- drivers/gpu/drm/vc4/vc4_irq.c | 2 - drivers/gpu/drm/vkms/vkms_output.c | 15 +- drivers/gpu/drm/vkms/vkms_plane.c | 10 +- drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 29 +++ drivers/gpu/drm/vmwgfx/vmwgfx_drv.h | 2 + drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 62 + drivers/gpu/drm/vmwgfx/vmwgfx_kms.h | 5 - drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c | 45 +++- drivers/gpu/drm/vmwgfx/vmwgfx_msg.c | 35 +-- drivers/gpu/drm/vmwgfx/vmwgfx_overlay.c | 6 - 21 files changed, 465 insertions(+), 303 deletions(-) create mode 100644 Documentation/devicetree/bindings/display/bridge/samsung,mipi-dsim.yaml delete mode 100644 Documentation/devicetree/bindings/display/exynos/exynos_dsim.txt
Re: [PATCH] fbmem: Reject FB_ACTIVATE_KD_TEXT from userspace
On 2023-04-11 15:44, Daniel Vetter wrote: On Tue, Apr 04, 2023 at 09:39:34PM +0200, Daniel Vetter wrote: This is an oversight from dc5bdb68b5b3 ("drm/fb-helper: Fix vt restore") - I failed to realize that nasty userspace could set this. It's not pretty to mix up kernel-internal and userspace uapi flags like this, but since the entire fb_var_screeninfo structure is uapi we'd need to either add a new parameter to the ->fb_set_par callback and fb_set_par() function, which has a _lot_ of users. Or some other fairly ugly side-channel int fb_info. Neither is a pretty prospect. Instead just correct the issue at hand by filtering out this kernel-internal flag in the ioctl handling code. Signed-off-by: Daniel Vetter Fixes: dc5bdb68b5b3 ("drm/fb-helper: Fix vt restore") Cc: Alex Deucher Cc: shl...@fastmail.com Cc: Michel Dänzer Cc: Noralf Trønnes Cc: Thomas Zimmermann Cc: Daniel Vetter Cc: Maarten Lankhorst Cc: Maxime Ripard Cc: David Airlie Cc: Daniel Vetter Cc: dri-devel@lists.freedesktop.org Cc: # v5.7+ Cc: Bartlomiej Zolnierkiewicz Cc: Geert Uytterhoeven Cc: Nathan Chancellor Cc: Qiujun Huang Cc: Peter Rosin Cc: linux-fb...@vger.kernel.org Cc: Helge Deller Cc: Sam Ravnborg Cc: Geert Uytterhoeven Cc: Samuel Thibault Cc: Tetsuo Handa Cc: Shigeru Yoshida An Ack on this (or a better idea) would be great, so I can stuff it into -fixes. Acked-by: Maarten Lankhorst
[PULL] drm-intel-gt-next
Hi Dave, Daniel, Pull request to avoid backmerges. ;) Cheers, ~Maarten drm-misc-next-2023-04-06: drm-misc-next for v6.4-rc1: UAPI Changes: Cross-subsystem Changes: - Document port and rotation dt bindings better. - For panel timing DT bindings, document that vsync and hsync are first, rather than last in image. - Fix video/aperture typos. Core Changes: - Reject prime DMA-Buf attachment if get_sg_table is missing. (For self-importing dma-buf only.) - Add prime import/export to vram-helper. - Fix oops in drm/vblank when init is not called. - Fixup xres/yres_virtual and other fixes in fb helper. - Improve SCDC debugs. - Skip setting deadline on modesets. - Assorted TTM fixes. Driver Changes: - Add lima usage stats. - Assorted fixes to bridge/lt8192b, tc358767, ivpu, bridge/ti-sn65dsi83, ps8640. - Use pci aperture helpers in drm/ast lynxfb, radeonfb. - Revert some lima patches, as they required a commit that has been reverted upstream. - Add AUO NE135FBM-N41 v8.1 eDP panel. - Add QAIC accel driver. The following changes since commit 7d690f936e9bc9fbd6394fb3d4ad181af03ee393: drm/panfrost: Add basic support for speed binning (2023-03-31 11:44:11 +0200) are available in the Git repository at: git://anongit.freedesktop.org/drm/drm-misc tags/drm-misc-next-2023-04-06 for you to fetch changes up to e44f18c6ff8beef7b2b10592287f0a9766376d9b: drm/ttm: Make the call to ttm_tt_populate() interruptible when faulting (2023-04-06 10:01:42 +0200) drm-misc-next for v6.4-rc1: UAPI Changes: Cross-subsystem Changes: - Document port and rotation dt bindings better. - For panel timing DT bindings, document that vsync and hsync are first, rather than last in image. - Fix video/aperture typos. Core Changes: - Reject prime DMA-Buf attachment if get_sg_table is missing. (For self-importing dma-buf only.) - Add prime import/export to vram-helper. - Fix oops in drm/vblank when init is not called. - Fixup xres/yres_virtual and other fixes in fb helper. - Improve SCDC debugs. - Skip setting deadline on modesets. - Assorted TTM fixes. Driver Changes: - Add lima usage stats. - Assorted fixes to bridge/lt8192b, tc358767, ivpu, bridge/ti-sn65dsi83, ps8640. - Use pci aperture helpers in drm/ast lynxfb, radeonfb. - Revert some lima patches, as they required a commit that has been reverted upstream. - Add AUO NE135FBM-N41 v8.1 eDP panel. - Add QAIC accel driver. Alexander Stein (2): drm/bridge: ti-sn65dsi83: use dev_err_probe if host attach failed drm/bridge: ti-sn65dsi86: Allow GPIO operations to sleep AngeloGioacchino Del Regno (1): drm/panel-edp: Add AUO NE135FBM-N41 v8.1 panel entry Daniel Vetter (7): drm/ast: Use drm_aperture_remove_conflicting_pci_framebuffers staging/lynxfb: Use pci aperture helper fbdev/radeon: use pci aperture helpers drm/fb-helper: set x/yres_virtual in drm_fb_helper_check_var drm/fb-helper: drop redundant pixclock check from drm_fb_helper_set_par() drm/fb-helper: fix input validation gaps in check_var drm/atomic-helper: Don't set deadline for modesets Erico Nunes (3): drm/lima: add usage counting method to ctx_mgr drm/lima: allocate unique id per drm_file drm/lima: add show_fdinfo for drm usage stats Francesco Dolcini (1): drm/bridge: lt8912b: Fix DSI Video Mode Harshit Mogalapalli (1): drm/lima/lima_drv: Add missing unwind goto in lima_pdev_probe() Jeffrey Hugo (7): accel/qaic: Add documentation for AIC100 accelerator driver accel/qaic: Add uapi and core driver file accel/qaic: Add MHI controller accel/qaic: Add control path accel/qaic: Add datapath accel/qaic: Add qaic driver to the build system MAINTAINERS: Add entry for QAIC driver Karol Wachowski (1): accel/ivpu: Remove D3hot delay for Meteorlake Krzysztof Kozlowski (5): dt-bindings: display: sitronix,st7789v: document dc-gpios dt-bindings: display: xinpeng,xpp055c272: document port dt-bindings: display: feiyang,fy07024di26a30d: document port dt-bindings: display: elida,kd35t133: document port and rotation dt-bindings: display: sitronix,st7701: document port and rotation Luca Ceresoli (2): drm: bridge: ldb: add missing \n in dev_warn() string drm: bridge: ldb: add support for using channel 1 only Marek Vasut (3): drm/bridge: tc358767: Enable DSI burst mode, LPM, non-continuous clock dt-bindings: display: Start the info graphics with HS/VS change drm/bridge: ti-sn65dsi83: Do not generate HFP/HBP/HSA and EOT packet Pin-yen Lin (1): drm/bridge: ps8640: Use constant sleep time for polling hpd Pranjal Ramajor Asha Kanojiya (1): accel/qaic: Add mhi_qaic_cntl Qiang Yu (3): Revert "drm/lima: add show_fdinfo for drm usage stats" Revert "drm/lima: allocate unique id per
Re: [PATCH] drm/doc/rfc: Introduce the merge plan for the Xe driver.
Hey, On 2023-04-05 21:52, Rodrigo Vivi wrote: Let’s establish a merge plan for Xe, by writing down clear pre-merge goals, in order to avoid unnecessary delays. This initial document starts with a TODO list containing items with clear and measurable key results. Xe’s initial pull request should only be sent to dri-devel after all the items are clearly resolved. Since many of them involve some level of a community consensus, in many cases, the consensus will be reached in follow-up patches to this document with more details of the API or helpers that will be developed or modified. Cc: Dave Airlie Cc: Daniel Vetter Cc: Oded Gabbay Signed-off-by: Rodrigo Vivi Signed-off-by: Francois Dugast Signed-off-by: Luis Strano Signed-off-by: Matthew Brost Signed-off-by: Thomas Hellström Signed-off-by: Maarten Lankhorst --- Documentation/gpu/rfc/index.rst | 4 + Documentation/gpu/rfc/xe.rst| 216 2 files changed, 220 insertions(+) create mode 100644 Documentation/gpu/rfc/xe.rst diff --git a/Documentation/gpu/rfc/index.rst b/Documentation/gpu/rfc/index.rst index 476719771eef..e4f7b005138d 100644 --- a/Documentation/gpu/rfc/index.rst +++ b/Documentation/gpu/rfc/index.rst @@ -31,3 +31,7 @@ host such documentation: .. toctree:: i915_vm_bind.rst + +.. toctree:: + + xe.rst diff --git a/Documentation/gpu/rfc/xe.rst b/Documentation/gpu/rfc/xe.rst new file mode 100644 index ..1e3e7e9c67c3 --- /dev/null +++ b/Documentation/gpu/rfc/xe.rst @@ -0,0 +1,216 @@ +== +Xe – Merge Acceptance Plan +== +Xe is a new driver for Intel GPUs that supports both integrated and +discrete platforms starting with Tiger Lake (first Intel Xe Architecture). + +This document aims to establish a merge plan for the Xe, by writing down clear +pre-merge goals, in order to avoid unnecessary delays. + +Xe – Overview += +The main motivation of Xe is to have a fresh base to work from that is +unencumbered by older platforms, whilst also taking the opportunity to +rearchitect our driver to increase sharing across the drm subsystem, both +leveraging and allowing us to contribute more towards other shared components +like TTM and drm/scheduler. + +This is also an opportunity to start from the beginning with a clean uAPI that is +extensible by design and already aligned with the modern userspace needs. For +this reason, the memory model is solely based on GPU Virtual Address space +bind/unbind (‘VM_BIND’) of GEM buffer objects (BOs) and execution only supporting +explicit synchronization. With persistent mapping across the execution, the +userspace does not need to provide a list of all required mappings during each +submission. + +The new driver leverages a lot from i915. As for display, the intent is to share +the display code with the i915 driver so that there is maximum reuse there. + +As for the power management area, the goal is to have a much-simplified support +for the system suspend states (S-states), PCI device suspend states (D-states), +GPU/Render suspend states (R-states) and frequency management. It should leverage +as much as possible all the existent PCI-subsystem infrastructure (pm and +runtime_pm) and underlying firmware components such PCODE and GuC for the power +states and frequency decisions. + +Repository: + +https://gitlab.freedesktop.org/drm/xe/kernel (branch drm-xe-next) + +Xe – Platforms +== +Currently, Xe is already functional and has experimental support for multiple +platforms starting from Tiger Lake, with initial support in userspace implemented +in Mesa (for Iris and Anv, our OpenGL and Vulkan drivers), as well as in NEO +(for OpenCL and Level0). + +During a transition period, platforms will be supported by both Xe and i915. +However, the force_probe mechanism existent in both drivers will allow only one +official and by-default probe at a given time. + +For instance, in order to probe a DG2 which PCI ID is 0x5690 by Xe instead of +i915, the following set of parameters need to be used: + +``` +i915.force_probe=!5690 xe.force_probe=5690 +``` + +In both drivers, the ‘.require_force_probe’ protection forces the user to use the +force_probe parameter while the driver is under development. This protection is +only removed when the support for the platform and the uAPI are stable. Stability +which needs to be demonstrated by CI results. + +In order to avoid user space regressions, i915 will continue to support all the +current platforms that are already out of this protection. Xe support will be +forever experimental and dependent on the usage of force_probe for these +platforms. + +When the time comes for Xe, the protection will be lifted on Xe and kept in i915. + +Xe driver will be protected with both STAGING Kconfig and force_probe. Changes in +the uAPI are expected while the driver is behind these protections. STAGING will +be removed when the driver uAPI gets
[PULL] drm-misc-next
Hi Dave, Daniel, Small update. Slow week. Felt like sending a pull request regardless. drm-misc-next-2023-03-31: drm-misc-next for v6.4-rc1: Cross-subsystem Changes: - DT bindings update for adding Mali MT81xx devices. - Assorted DT binding updates. Core Changes: - Documentation update to scheduler. Driver Changes: - Add support for the same mali devices. - Add support for speed binning to panfrost. - Add B133UAN01.0 eDP panel. - Assorted small fixes to bridge/ps8640, bridge/it6505, panel/magnachip. - Use of_property_read_bool in ps8622 and ofdrm. The following changes since commit 82bbec189ab34873688484cd14189a5392946fbb: Merge v6.3-rc4 into drm-next (2023-03-29 16:00:23 +0200) are available in the Git repository at: git://anongit.freedesktop.org/drm/drm-misc tags/drm-misc-next-2023-03-31 for you to fetch changes up to 7d690f936e9bc9fbd6394fb3d4ad181af03ee393: drm/panfrost: Add basic support for speed binning (2023-03-31 11:44:11 +0200) drm-misc-next for v6.4-rc1: Cross-subsystem Changes: - DT bindings update for adding Mali MT81xx devices. - Assorted DT binding updates. Core Changes: - Documentation update to scheduler. Driver Changes: - Add support for the same mali devices. - Add support for speed binning to panfrost. - Add B133UAN01.0 eDP panel. - Assorted small fixes to bridge/ps8640, bridge/it6505, panel/magnachip. - Use of_property_read_bool in ps8622 and ofdrm. Alyssa Rosenzweig (3): drm/panfrost: Increase MAX_PM_DOMAINS to 5 drm/panfrost: Add the MT8192 GPU ID drm/panfrost: Add mediatek,mt8192-mali compatible AngeloGioacchino Del Regno (11): dt-bindings: gpu: mali-bifrost: Split out MediaTek power-domains variation dt-bindings: gpu: mali-bifrost: Set power-domains maxItems to 5 dt-bindings: gpu: mali-bifrost: Fix power-domain-names validation dt-bindings: gpu: mali-bifrost: Add sub-schema for MT8192's power domains dt-bindings: gpu: mali-bifrost: Add new MT8183 compatible dt-bindings: gpu: mali-bifrost: Add support for MediaTek MT8186 dt-bindings: gpu: mali-bifrost: Add compatible for MT8195 SoC drm/panfrost: Add new compatible for Mali on the MT8183 SoC drm/panfrost: Add support for Mali on the MT8186 SoC dt-bindings: gpu: mali-bifrost: Document nvmem for speedbin support drm/panfrost: Add basic support for speed binning Bjorn Andersson (1): drm/panel-edp: Add B133UAN01.0 edp panel entry Caio Novais (1): drm/scheduler: Fix variable name in function description Dan Carpenter (1): drm/panel: magnachip: Prevent error pointer dereference in probe Fabio Estevam (1): dt-bindings: display: seiko,43wvf1g: Change the maintainer's contact Hsin-Yi Wang (1): drm/bridge: it6505: Add range and selector_reg Krzysztof Kozlowski (6): dt-bindings: display: panel-simple: merge Innolux p120zdg-bf1 dt-bindings: display: novatek,nt36672a: correct VDDIO supply dt-bindings: display: panel-simple-dsi: allow vddio variant dt-bindings: display: panel-simple-dsi: document port dt-bindings: display: visionox,rm69299: document reg dt-bindings: display: boe,tv101wum-nl6: document rotation Maarten Lankhorst (1): Merge remote-tracking branch 'drm/drm-next' into drm-misc-next Pin-yen Lin (3): drm/bridge: ps8640: Skip redundant bridge enable drm/bridge: ps8640: Add a cache for EDID drm/bridge: ps8640: Return NULL immediately when EDID read fail Rob Herring (3): dt-bindings: display: Drop unneeded quotes drm: Use of_property_present() for testing DT property presence drm: Use of_property_read_bool() for boolean properties .../bindings/auxdisplay/holtek,ht16k33.yaml| 2 +- .../bindings/display/amlogic,meson-dw-hdmi.yaml| 4 +- .../bindings/display/amlogic,meson-vpu.yaml| 4 +- .../bindings/display/bridge/analogix,anx7625.yaml | 4 +- .../bindings/display/bridge/cdns,mhdp8546.yaml | 4 +- .../bindings/display/bridge/nxp,ptn3460.yaml | 2 +- .../bindings/display/bridge/toshiba,tc358767.yaml | 2 +- .../devicetree/bindings/display/dp-aux-bus.yaml| 2 +- .../bindings/display/imx/nxp,imx8mq-dcss.yaml | 4 +- .../bindings/display/mediatek/mediatek,hdmi.yaml | 2 +- .../bindings/display/msm/dsi-controller-main.yaml | 8 +- .../bindings/display/msm/dsi-phy-10nm.yaml | 2 +- .../devicetree/bindings/display/msm/gmu.yaml | 4 +- .../devicetree/bindings/display/msm/gpu.yaml | 4 +- .../devicetree/bindings/display/msm/mdp4.yaml | 4 +- .../bindings/display/panel/boe,tv101wum-nl6.yaml | 1 + .../display/panel/innolux,p120zdg-bf1.yaml | 43 --- .../bindings/display/panel/novatek,nt36672a.yaml | 6 +- .../bindings/display/panel/panel-simple-dsi.yaml | 24 +- .../bindings/display/panel
Re: [PATCH v3 1/7] drm/dp_helper: Add helper to check DSC support with given o/p format
ack On 2023-03-20 09:59, Jani Nikula wrote: Thomas, Maxime, Maarten, ack for merging this one via drm-intel? BR, Jani. On Thu, 09 Mar 2023, Suraj Kandpal wrote: From: Ankit Nautiyal Add helper to check if the DP sink supports DSC with the given o/p format. v2: Add documentation for the helper. (Uma Shankar) v3: /** instead of /* (Uma Shankar) Signed-off-by: Ankit Nautiyal Reviewed-by: Uma Shankar --- include/drm/display/drm_dp_helper.h | 13 + 1 file changed, 13 insertions(+) diff --git a/include/drm/display/drm_dp_helper.h b/include/drm/display/drm_dp_helper.h index ab55453f2d2c..533d3ee7fe05 100644 --- a/include/drm/display/drm_dp_helper.h +++ b/include/drm/display/drm_dp_helper.h @@ -194,6 +194,19 @@ drm_dp_dsc_sink_max_slice_width(const u8 dsc_dpcd[DP_DSC_RECEIVER_CAP_SIZE]) DP_DSC_SLICE_WIDTH_MULTIPLIER; } +/** + * drm_dp_dsc_sink_supports_format() - check if sink supports DSC with given output format + * @dsc_dpcd : DSC-capability DPCDs of the sink + * @output_format: output_format which is to be checked + * + * Returns true if the sink supports DSC with the given output_format, false otherwise. + */ +static inline bool +drm_dp_dsc_sink_supports_format(const u8 dsc_dpcd[DP_DSC_RECEIVER_CAP_SIZE], u8 output_format) +{ + return dsc_dpcd[DP_DSC_DEC_COLOR_FORMAT_CAP - DP_DSC_SUPPORT] & output_format; +} + /* Forward Error Correction Support on DP 1.4 */ static inline bool drm_dp_sink_supports_fec(const u8 fec_capable)
[PULL] drm-misc-next
Hi Dave, Daniel, Lots of small commits with cleanup and fixes this time around, nothing major otherwise. Cheers, ~Maarten drm-misc-next-2023-03-23: drm-misc-next for v6.4-rc1: Core Changes: - Add unit test for xrgb to mono. - Assorted small fixes to format helper selftests. - Assorted documentation updates. - Drop drm_dev_set_unique. - Always use shadow buffer in generic fbdev emulation helpers, and improve error handling. Driver Changes: - Assorted small fixes to malidp, hdlcd, gma500, lima, bridge, rockchip. - Move fbdev in gma500 to use drm_client. - Convert bridge platform callbacks to void return. - Drop leftover from vgem to shmem helper conversion. The following changes since commit b24343eaceedb902c1625854f85a193b0549d85f: drm/nouveau/nvfw/acr: set wpr_generic_header_dump storage-class-specifier to static (2023-03-16 14:53:15 +0100) are available in the Git repository at: git://anongit.freedesktop.org/drm/drm-misc tags/drm-misc-next-2023-03-23 for you to fetch changes up to 4ab9157c7e02019fa8d8ab98d4f9e67e6a7cfad1: drm/rockchip: vop2: Add error check to devm_regmap_init_mmio (2023-03-23 00:18:58 +0100) drm-misc-next for v6.4-rc1: Core Changes: - Add unit test for xrgb to mono. - Assorted small fixes to format helper selftests. - Assorted documentation updates. - Drop drm_dev_set_unique. - Always use shadow buffer in generic fbdev emulation helpers, and improve error handling. Driver Changes: - Assorted small fixes to malidp, hdlcd, gma500, lima, bridge, rockchip. - Move fbdev in gma500 to use drm_client. - Convert bridge platform callbacks to void return. - Drop leftover from vgem to shmem helper conversion. Adam Ford (1): drm/bridge: adv7533: Fix adv7533_mode_valid for adv7533 and adv7535 Alfredo Cruz (1): drm/rockchip: vop2: Add error check to devm_regmap_init_mmio Arthur Grillo (2): drm/format-helper: Add Kunit tests for drm_fb_xrgb_to_mono() drm/format-helper: Make "destination_pitch" test usable for mono Christian König (1): drm: remove drm_dev_set_unique Javier Martinez Canillas (1): drm/format-helper: Use drm_format_info_min_pitch() in tests helper Lee Jones (1): drm/ttm/ttm_bo: Provide a missing 'bulk' description and correct misnaming of 'placement' Maíra Canal (2): drm/vgem: Drop struct drm_vgem_gem_object drm/lima: Use drm_sched_job_add_syncobj_dependency() Petr Tesarik (1): drm/prime: Fix documentation of drm_gem_prime_fd_to_handle() Simon Ser (1): drm: fix typo in margin connector properties docs Thomas Zimmermann (15): drm/gma500: Remove unnecessary include statements drm/gma500: Move fbdev code into separate source file drm/gma500: Remove fbdev vma open and close callbacks drm/gma500: Fix naming in fb_ops drm/gma500: Inline psbfb_create() into psbfb_probe() drm/gma500: Implement client-based fbdev emulation drm/gma500: Pass fb_info to psb_fbdev_vm_fault() drm/fbdev-generic: Always use shadow buffering drm/fbdev-generic: Remove unused prefer_shadow_fbdev flag drm/fb-helper: Export drm_fb_helper_release_info() drm/fb-helper: Support smem_len in deferred I/O drm/fbdev-generic: Set screen size to size of GEM buffer drm/fbdev-generic: Clean up after failed probing drm/fb-helper: Consolidate CONFIG_DRM_FBDEV_LEAK_PHYS_SMEM drm/fbdev-generic: Rename symbols Toby Chen (1): drm/rockchip: dw_hdmi: cleanup drm encoder during unbind Tom Rix (3): gpu: drm: bridge: sii9234: remove unused bridge_to_sii9234 function drm/gma500: remove unused gma_pipe_event function drm/rockchip: vop2: fix uninitialized variable possible_crtcs Uwe Kleine-König (17): drm/bridge: cdns-dsi: Convert to platform remove callback returning void drm/bridge: display-connector: Convert to platform remove callback returning void drm/bridge: fsl-ldb: Convert to platform remove callback returning void drm/bridge: imx8qm-ldb: Convert to platform remove callback returning void drm/bridge: imx8qxp-ldb: Convert to platform remove callback returning void drm/bridge: imx8qxp-pixel-combiner: Convert to platform remove callback returning void drm/bridge: imx8qxp-pixel-link: Convert to platform remove callback returning void drm/bridge: imx8qxp-pxl2dpi: Convert to platform remove callback returning void drm/bridge: lvds-codec: Convert to platform remove callback returning void drm/bridge: nwl-dsi: Convert to platform remove callback returning void drm/bridge: simple-bridg: Convert to platform remove callback returning void drm/bridge: dw-hdmi-ahb-audio: Convert to platform remove callback returning void drm/bridge: dw-hdmi-cec: Convert to platform remove callback returning void drm/bridge:
[PULL] drm-misc-next
Hi Dave, Daniel, Here's the new weekly pull request for v6.4-rc1. I've omitted the diffstat, as it was huge because v6.3-rc1 was backmerged. Cheers, ~Maarten drm-misc-next-2023-03-16: drm-misc-next for v6.4-rc1: Cross-subsystem Changes: - Add drm_bridge.h to drm_bridge maintainers. Core Changes: - Assorted fixes to TTM, tests, format-helper, accel. - Assorted Makefile fixes to drivers and accel. - Implement fbdev emulation for GEM DMA drivers, and convert a lot of drivers to use it. - Use tgid instead of pid for tracking clients. Driver Changes: - Assorted fixes in rockchip, vmwgfx, nouveau, cirrus. - Add imx25 driver. - Add Elida KD50T048A, Sony TD4353, Novatek NT36523, STARRY 2081101QFH032011-53G panels. - Add 4K mode support to rockchip. - Convert cirrus to use regular atomic helpers, and more cirrus improvements. - Add damage clipping to cirrus, virtio. The following changes since commit 9228742caf899fa72230dd8da19ca4c7528badb8: drm/nouveau/hwmon: Use sysfs_emit in show function callsbacks (2023-03-06 19:42:50 -0500) are available in the Git repository at: git://anongit.freedesktop.org/drm/drm-misc tags/drm-misc-next-2023-03-16 for you to fetch changes up to b24343eaceedb902c1625854f85a193b0549d85f: drm/nouveau/nvfw/acr: set wpr_generic_header_dump storage-class-specifier to static (2023-03-16 14:53:15 +0100) drm-misc-next for v6.4-rc1: Cross-subsystem Changes: - Add drm_bridge.h to drm_bridge maintainers. Core Changes: - Assorted fixes to TTM, tests, format-helper, accel. - Assorted Makefile fixes to drivers and accel. - Implement fbdev emulation for GEM DMA drivers, and convert a lot of drivers to use it. - Use tgid instead of pid for tracking clients. Driver Changes: - Assorted fixes in rockchip, vmwgfx, nouveau, cirrus. - Add imx25 driver. - Add Elida KD50T048A, Sony TD4353, Novatek NT36523, STARRY 2081101QFH032011-53G panels. - Add 4K mode support to rockchip. - Convert cirrus to use regular atomic helpers, and more cirrus improvements. - Add damage clipping to cirrus, virtio. Fabio Estevam (2): dt-bindings: display: seiko,43wvf1g: Add the 'enable-gpios' property drm/panel: seiko-43wvf1g: Add the 'enable-gpios' property Gerald Loacker (1): drm/rockchip: vop2: add polarity flags to RGB output Jacob Keller (1): drm/rockchip: vop2: use struct_size() in vop2_bind Javier Martinez Canillas (2): drm/format-helper: Make conversion_buf_size() support sub-byte pixel fmts drm/virtio: Enable fb damage clips property for the primary plane Jianhua Lu (2): dt-bindings: display: panel: Add Novatek NT36523 bindings drm/panel: Add driver for Novatek NT36523 Jiapeng Chong (1): drm/rockchip: dsi: Remove the unused function dsi_read() Konrad Dybcio (2): dt-bindings: display/panel: Add Sony Tama TD4353 JDI display panel gpu/drm/panel: Add Sony TD4353 JDI panel driver Linus Walleij (1): drm/mcde: Do not use dirty GEM FB handling Liu Ying (1): MAINTAINERS: Add include/drm/drm_bridge.h to DRM DRIVERS FOR BRIDGE CHIPS Marian Cichy (1): drm/imx/lcdc: Implement DRM driver for imx25 Maya Matuszczyk (3): dt-bindings: display: panel: sitronix,st7701: Add Elida KD50T048A Panel drm: panel: Add Elida KD50T048A to Sitronix ST7701 driver drm: panel: Add orientation support for st7701 Ruihai Zhou (2): dt-bindings: display: panel: Add compatible for Starry 2081101QFH032011-53G drm/panel: support for STARRY 2081101QFH032011-53G MIPI-DSI panel Sascha Hauer (4): drm/rockchip: vop: limit maximum resolution to hardware capabilities drm/rockchip: dw_hdmi: relax mode_valid hook drm/rockchip: dw_hdmi: Add support for 4k@30 resolution drm/rockchip: dw_hdmi: discard modes with unachievable pixelclocks Stanislaw Gruszka (1): accel: Build sub-directories based on config options Thomas Hellström (3): drm/ttm: Use the BIT macro for the TTM_TT_FLAGs drm/ttm: Unexport ttm_global_swapout() drm/ttm: Don't print error message if eviction was interrupted Thomas Zimmermann (42): Merge drm/drm-next into drm-misc-next drm/cirrus: Compute blit destination offset in single location drm/cirrus: Replace cpp value with format drm/cirrus: Use drm_fb_blit() to update scanout buffer drm/cirrus: Move drm_dev_{enter, exit}() into DRM helpers drm/cirrus: Split cirrus_mode_set() into smaller functions drm/cirrus: Integrate connector into pipeline code drm/cirrus: Move primary-plane format arrays drm/cirrus: Convert to regular atomic helpers drm/cirrus: Enable damage clipping on primary plane drm/cirrus: Inline cirrus_fb_blit_rect() drm/cirrus: Remove format test from cirrus_fb_create() drm/cirrus: Remove size test from cirrus_fb_create()
Re: [Intel-gfx] [Intel-xe] [PATCH] drm/xe/display: Do not use i915 frontbuffer tracking implementation
On 2023-03-09 12:04, Hogander, Jouni wrote: On Mon, 2023-03-06 at 22:58 +0200, Ville Syrjälä wrote: On Mon, Mar 06, 2023 at 09:23:50PM +0100, Maarten Lankhorst wrote: Hey, On 2023-03-06 16:23, Souza, Jose wrote: On Mon, 2023-03-06 at 15:16 +0100, Maarten Lankhorst wrote: As a fallback if we decide not to merge the frontbuffer tracking, allow i915 to keep its own implementation, and do the right thing in Xe. The frontbuffer tracking for Xe is still done per-fb, while i915 can keep doing the weird intel_frontbuffer + i915_active thing without blocking Xe. Please also disable PSR and FBC with this or at least add a way for users to disable those features. Without frontbuffer tracker those two features will break in some cases. FBC and PSR work completely as expected. I don't remove frontbuffer tracking; I only remove the GEM parts. Explicit invalidation using pageflip or CPU rendering + DirtyFB continue to work, as I validated on my laptop with FBC. Neither of which are relevant to the removal of the gem hooks. Like I already said ~10 times in the last meeting, we need a proper testcase. Here's a rough idea what it should do: prepare a batch with 1. spinner 2. something that clobbers the fb Then 1. grab reference crc 2. execbuffer 3. dirtyfb 4. wait long enough for fbc to recompress 5. terminate spinner 6. gem_sync 7. grab crc and compare with reference No idea what the current status of PSR+CRC is, so not sure whether we can actually test PSR or not. CRC calculation doesn't work with PSR currently. PSR is disabled if CRC capture is requested. Are we supposed to support frontbuffer rendering using GPU? No other driver does that. It's fine if DirtyFB hangs instead until the job it waits on completes. ~Maarten
Re: [Intel-gfx] [Intel-xe] [PATCH] drm/xe/display: Do not use i915 frontbuffer tracking implementation
Hey, On 2023-03-08 14:36, Ville Syrjälä wrote: On Wed, Mar 08, 2023 at 01:47:12PM +0100, Maarten Lankhorst wrote: On 2023-03-06 21:58, Ville Syrjälä wrote: On Mon, Mar 06, 2023 at 09:23:50PM +0100, Maarten Lankhorst wrote: Hey, On 2023-03-06 16:23, Souza, Jose wrote: On Mon, 2023-03-06 at 15:16 +0100, Maarten Lankhorst wrote: As a fallback if we decide not to merge the frontbuffer tracking, allow i915 to keep its own implementation, and do the right thing in Xe. The frontbuffer tracking for Xe is still done per-fb, while i915 can keep doing the weird intel_frontbuffer + i915_active thing without blocking Xe. Please also disable PSR and FBC with this or at least add a way for users to disable those features. Without frontbuffer tracker those two features will break in some cases. FBC and PSR work completely as expected. I don't remove frontbuffer tracking; I only remove the GEM parts. Explicit invalidation using pageflip or CPU rendering + DirtyFB continue to work, as I validated on my laptop with FBC. Neither of which are relevant to the removal of the gem hooks. Like I already said ~10 times in the last meeting, we need a proper testcase. Here's a rough idea what it should do: prepare a batch with 1. spinner 2. something that clobbers the fb Then 1. grab reference crc 2. execbuffer 3. dirtyfb 4. wait long enough for fbc to recompress 5. terminate spinner 6. gem_sync 7. grab crc and compare with reference No idea what the current status of PSR+CRC is, so not sure whether we can actually test PSR or not. This test doesn't make sense. DirtyFB should simply not return before execbuffer finishes. Of course it should. It's not a blocking ioctl, and can't be because that will make X unusable. Except it actually is. DirtyFB blocks in its default implementation, and waits for the next vblank. drm_atomic_helper_dirtyfb() blocks by default as it's a synchronous plane update. Considering every driver except i915 uses it, it works just fine. :) ~Maarten
Re: [Intel-gfx] [Intel-xe] [PATCH] drm/xe/display: Do not use i915 frontbuffer tracking implementation
On 2023-03-06 21:58, Ville Syrjälä wrote: On Mon, Mar 06, 2023 at 09:23:50PM +0100, Maarten Lankhorst wrote: Hey, On 2023-03-06 16:23, Souza, Jose wrote: On Mon, 2023-03-06 at 15:16 +0100, Maarten Lankhorst wrote: As a fallback if we decide not to merge the frontbuffer tracking, allow i915 to keep its own implementation, and do the right thing in Xe. The frontbuffer tracking for Xe is still done per-fb, while i915 can keep doing the weird intel_frontbuffer + i915_active thing without blocking Xe. Please also disable PSR and FBC with this or at least add a way for users to disable those features. Without frontbuffer tracker those two features will break in some cases. FBC and PSR work completely as expected. I don't remove frontbuffer tracking; I only remove the GEM parts. Explicit invalidation using pageflip or CPU rendering + DirtyFB continue to work, as I validated on my laptop with FBC. Neither of which are relevant to the removal of the gem hooks. Like I already said ~10 times in the last meeting, we need a proper testcase. Here's a rough idea what it should do: prepare a batch with 1. spinner 2. something that clobbers the fb Then 1. grab reference crc 2. execbuffer 3. dirtyfb 4. wait long enough for fbc to recompress 5. terminate spinner 6. gem_sync 7. grab crc and compare with reference No idea what the current status of PSR+CRC is, so not sure whether we can actually test PSR or not. This test doesn't make sense. DirtyFB should simply not return before execbuffer finishes. ~Maarten
Re: [PATCH RFC 11/18] drm/scheduler: Clean up jobs when the scheduler is torn down
On 2023-03-07 15:25, Asahi Lina wrote: drm_sched_fini() currently leaves any pending jobs dangling, which causes segfaults and other badness when job completion fences are signaled after the scheduler is torn down. Explicitly detach all jobs from their completion callbacks and free them. This makes it possible to write a sensible safe abstraction for drm_sched, without having to externally duplicate the tracking of in-flight jobs. This shouldn't regress any existing drivers, since calling drm_sched_fini() with any pending jobs is broken and this change should be a no-op if there are no pending jobs. Signed-off-by: Asahi Lina --- drivers/gpu/drm/scheduler/sched_main.c | 27 +-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/scheduler/sched_main.c b/drivers/gpu/drm/scheduler/sched_main.c index 5c0add2c7546..0aab1e0aebdd 100644 --- a/drivers/gpu/drm/scheduler/sched_main.c +++ b/drivers/gpu/drm/scheduler/sched_main.c @@ -1119,10 +1119,33 @@ EXPORT_SYMBOL(drm_sched_init); void drm_sched_fini(struct drm_gpu_scheduler *sched) { struct drm_sched_entity *s_entity; + struct drm_sched_job *s_job, *tmp; int i; - if (sched->thread) - kthread_stop(sched->thread); + if (!sched->thread) + return; + + /* +* Stop the scheduler, detaching all jobs from their hardware callbacks +* and cleaning up complete jobs. +*/ + drm_sched_stop(sched, NULL); + + /* +* Iterate through the pending job list and free all jobs. +* This assumes the driver has either guaranteed jobs are already stopped, or that +* otherwise it is responsible for keeping any necessary data structures for +* in-progress jobs alive even when the free_job() callback is called early (e.g. by +* putting them in its own queue or doing its own refcounting). +*/ + list_for_each_entry_safe(s_job, tmp, >pending_list, list) { + spin_lock(>job_list_lock); + list_del_init(_job->list); + spin_unlock(>job_list_lock); + sched->ops->free_job(s_job); + } I would stop the kthread first, then delete all jobs without spinlock since nothing else can race against sched_fini? If you do need the spinlock, It would need to guard list_for_each_entry too. + + kthread_stop(sched->thread); for (i = DRM_SCHED_PRIORITY_COUNT - 1; i >= DRM_SCHED_PRIORITY_MIN; i--) { struct drm_sched_rq *rq = >sched_rq[i];
[PULL] drm-misc-next
Add Radxa Display 10HD drm: panel: jd9365da-h3: Add Radxa Display 10HD dt-bindings: display: panel: jadard,jd9365da-h3: Add Radxa Display 8HD drm: panel: jd9365da-h3: Add Radxa Display 8HD Jani Nikula (5): drm/displayid: add displayid_get_header() and check bounds better drm/displayid: return struct displayid_header from validate_displayid() drm/displayid: provide access to DisplayID version and primary use case drm/edid: update non-desktop use also from DisplayID drm/edid: parse Tiled Display Topology Data Block for DisplayID 2.0 Jiri Slaby (SUSE) (1): drm/nouveau/kms/nv50: fix nv50_wndw_new_ prototype Johan Jonker (7): dt-bindings: display: rockchip: convert rockchip-lvds.txt to YAML dt-bindings: soc: rockchip: grf: add rockchip,lvds.yaml dt-bindings: display: dsi-controller: move clock-master property dt-bindings: display: bridge: snps,dw-mipi-dsi: fix clock properties dt-bindings: display: rockchip: convert dw_mipi_dsi_rockchip.txt to yaml dt-bindings: display: bridge: convert analogix_dp.txt to yaml dt-bindings: display: rockchip: convert analogix_dp-rockchip.txt to yaml John Keeping (2): drm/rockchip: avoid duplicate mappings for IOMMU devices drm/bridge: panel: Set orientation on panel_bridge connector Maarten Lankhorst (3): drm/suballoc: Extract amdgpu_sa.c as generic suballocation helper drm/amd: Convert amdgpu to use suballocation helper. drm/radeon: Use the drm suballocation manager implementation. Matthew Auld (6): drm/i915/ttm: fix sparse warning drm/i915/ttm: audit remaining bo->resource drm/ttm: clear the ttm_tt when bo->resource is NULL drm/gem-vram: handle NULL bo->resource in move callback drm/qxl: handle NULL bo->resource in move callback drm/radeon: handle NULL bo->resource in move callback Maxime Ripard (4): drm/vc4: hdmi: Replace hardcoded value by define drm/vc4: hdmi: Enable power domain before setting minimum Revert "drm/vc4: hdmi: Fix HSM clock too low on Pi4" Revert "drm/vc4: hdmi: Enforce the minimum rate at runtime_resume" Maíra Canal (8): drm/format-helper: Use KUNIT_EXPECT_MEMEQ macro drm/vgem: add missing mutex_destroy drm/sched: Create wrapper to add a syncobj dependency to job drm/panfrost: Use drm_sched_job_add_syncobj_dependency() drm/v3d: Use drm_sched_job_add_syncobj_dependency() drm/vc4: replace drm_gem_dma_object for drm_gem_object in vc4_exec_info drm/vc4: replace obj lookup steps with drm_gem_objects_lookup dma-buf: Include missing parentheses to documentation Michael Riesch (5): drm/rockchip: vop2: initialize possible_crtcs properly drm/rockchip: rgb: embed drm_encoder into rockchip_encoder drm/rockchip: rgb: add video_port parameter to init function drm/rockchip: vop2: use symmetric function pair vop2_{create,destroy}_crtcs drm/rockchip: vop2: add support for the rgb output block Neil Armstrong (1): MAINTAINERS: Add myself as maintainer for DRM Panels drivers Randy Dunlap (1): drm/bridge: Kconfig: fix a spelling mistake Rayyan Ansari (2): drm/simpledrm: Allow physical width and height configuration via panel node dt-bindings: display: simple-framebuffer: Document the panel node Rob Clark (3): drm/shmem: Cleanup drm_gem_shmem_create_with_handle() drm/rockchip: Drop unbalanced obj unref drm/virtio: Add option to disable KMS support Simon Ser (5): drm: document DRM_IOCTL_GEM_CLOSE drm: document expectations for GETFB2 handles drm: document DRM_IOCTL_PRIME_HANDLE_TO_FD and PRIME_FD_TO_HANDLE drm: document connector margin properties drm: remove outdated doc TODO for subconnector property Somalapuram Amaranath (1): drm/amdgpu: Remove TTM resource->start visible VRAM condition v2 Stanislaw Gruszka (2): accel/ivpu: Set dma max_segment_size accel/ivpu: Fix old dma_buf api usage Stephen Boyd (1): drm/panel: boe-tv101wum-nl6: Ensure DSI writes succeed during disable Thomas Weißschuh (2): drm/nouveau/led: explicitly include linux/leds.h dma-buf: make kobj_type structure constant Thomas Zimmermann (23): Merge drm/drm-next into drm-misc-next fbdev: Fix contact info in fb_cmdline.c fbdev: Transfer video= option strings to caller; clarify ownership fbdev: Support NULL for name in option-string lookup drivers/ps3: Read video= option with fb_get_option() fbdev: Read video= option with fb_get_option() in modedb fbdev: Unexport fb_mode_option fbdev: Move option-string lookup into helper fbdev: Handle video= parameter in video/cmdline.c driver/ps3: Include for mode parsing drm: Include for mode parsing drm: Fix comment on mode parsing drm/atomic-helper: Add atomic_enable plane-helper
Re: [Intel-xe] [PATCH] drm/xe/display: Do not use i915 frontbuffer tracking implementation
Hey, On 2023-03-06 16:23, Souza, Jose wrote: On Mon, 2023-03-06 at 15:16 +0100, Maarten Lankhorst wrote: As a fallback if we decide not to merge the frontbuffer tracking, allow i915 to keep its own implementation, and do the right thing in Xe. The frontbuffer tracking for Xe is still done per-fb, while i915 can keep doing the weird intel_frontbuffer + i915_active thing without blocking Xe. Please also disable PSR and FBC with this or at least add a way for users to disable those features. Without frontbuffer tracker those two features will break in some cases. FBC and PSR work completely as expected. I don't remove frontbuffer tracking; I only remove the GEM parts. Explicit invalidation using pageflip or CPU rendering + DirtyFB continue to work, as I validated on my laptop with FBC. Signed-off-by: Maarten Lankhorst --- .../gpu/drm/i915/display/intel_display_types.h | 12 drivers/gpu/drm/i915/display/intel_drrs.c | 1 + drivers/gpu/drm/i915/display/intel_fb.c | 8 +--- drivers/gpu/drm/i915/display/intel_fbdev.c | 2 +- .../gpu/drm/i915/display/intel_frontbuffer.c| 17 + .../gpu/drm/i915/display/intel_frontbuffer.h| 12 ++-- drivers/gpu/drm/i915/display/intel_psr.c| 1 + .../gpu/drm/i915/display/skl_universal_plane.c | 2 ++ 8 files changed, 45 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_display_types.h b/drivers/gpu/drm/i915/display/intel_display_types.h index f2918bb07107..a4a57aa24422 100644 --- a/drivers/gpu/drm/i915/display/intel_display_types.h +++ b/drivers/gpu/drm/i915/display/intel_display_types.h @@ -133,7 +133,11 @@ struct intel_fb_view { struct intel_framebuffer { struct drm_framebuffer base; +#ifdef I915 struct intel_frontbuffer *frontbuffer; +#else + atomic_t bits; +#endif /* Params to remap the FB pages and program the plane registers in each view. */ struct intel_fb_view normal_view; @@ -2074,10 +2078,18 @@ static inline u32 intel_plane_ggtt_offset(const struct intel_plane_state *plane_ #endif } +#ifdef I915 static inline struct intel_frontbuffer * to_intel_frontbuffer(struct drm_framebuffer *fb) { return fb ? to_intel_framebuffer(fb)->frontbuffer : NULL; } +#else +static inline struct intel_framebuffer * +to_intel_frontbuffer(struct drm_framebuffer *fb) +{ + return fb ? to_intel_framebuffer(fb) : NULL; +} +#endif #endif /* __INTEL_DISPLAY_TYPES_H__ */ diff --git a/drivers/gpu/drm/i915/display/intel_drrs.c b/drivers/gpu/drm/i915/display/intel_drrs.c index 5b9e3814..3503d112387d 100644 --- a/drivers/gpu/drm/i915/display/intel_drrs.c +++ b/drivers/gpu/drm/i915/display/intel_drrs.c @@ -9,6 +9,7 @@ #include "intel_de.h" #include "intel_display_types.h" #include "intel_drrs.h" +#include "intel_frontbuffer.h" #include "intel_panel.h" /** diff --git a/drivers/gpu/drm/i915/display/intel_fb.c b/drivers/gpu/drm/i915/display/intel_fb.c index 8c357a4098f6..e67c71f9b29d 100644 --- a/drivers/gpu/drm/i915/display/intel_fb.c +++ b/drivers/gpu/drm/i915/display/intel_fb.c @@ -1846,6 +1846,8 @@ static void intel_user_framebuffer_destroy(struct drm_framebuffer *fb) #ifdef I915 if (intel_fb_uses_dpt(fb)) intel_dpt_destroy(intel_fb->dpt_vm); + + intel_frontbuffer_put(intel_fb->frontbuffer); #else if (intel_fb_obj(fb)->flags & XE_BO_CREATE_PINNED_BIT) { struct xe_bo *bo = intel_fb_obj(fb); @@ -1857,8 +1859,6 @@ static void intel_user_framebuffer_destroy(struct drm_framebuffer *fb) } #endif - intel_frontbuffer_put(intel_fb->frontbuffer); - kfree(intel_fb); } @@ -1966,9 +1966,9 @@ int intel_framebuffer_init(struct intel_framebuffer *intel_fb, obj->flags |= XE_BO_SCANOUT_BIT; } ttm_bo_unreserve(>ttm); -#endif atomic_set(_fb->bits, 0); +#endif if (!drm_any_plane_has_format(_priv->drm, mode_cmd->pixel_format, @@ -2085,7 +2085,9 @@ int intel_framebuffer_init(struct intel_framebuffer *intel_fb, return 0; err: +#ifdef I915 intel_frontbuffer_put(intel_fb->frontbuffer); +#endif return ret; } diff --git a/drivers/gpu/drm/i915/display/intel_fbdev.c b/drivers/gpu/drm/i915/display/intel_fbdev.c index 75d8029185f0..2682b26b511f 100644 --- a/drivers/gpu/drm/i915/display/intel_fbdev.c +++ b/drivers/gpu/drm/i915/display/intel_fbdev.c @@ -82,7 +82,7 @@ struct intel_fbdev { static struct intel_frontbuffer *to_frontbuffer(struct intel_fbdev *ifbdev) { - return ifbdev->fb->frontbuffer; + return to_intel_frontbuffer(>fb->base); } static void intel_fbdev_invalidate(struct intel_fbdev *ifbdev) diff --git a/drivers/gpu/drm/i915/display/intel_frontbuffer.c b/drivers
[PATCH] drm/xe/display: Do not use i915 frontbuffer tracking implementation
As a fallback if we decide not to merge the frontbuffer tracking, allow i915 to keep its own implementation, and do the right thing in Xe. The frontbuffer tracking for Xe is still done per-fb, while i915 can keep doing the weird intel_frontbuffer + i915_active thing without blocking Xe. Signed-off-by: Maarten Lankhorst --- .../gpu/drm/i915/display/intel_display_types.h | 12 drivers/gpu/drm/i915/display/intel_drrs.c | 1 + drivers/gpu/drm/i915/display/intel_fb.c | 8 +--- drivers/gpu/drm/i915/display/intel_fbdev.c | 2 +- .../gpu/drm/i915/display/intel_frontbuffer.c| 17 + .../gpu/drm/i915/display/intel_frontbuffer.h| 12 ++-- drivers/gpu/drm/i915/display/intel_psr.c| 1 + .../gpu/drm/i915/display/skl_universal_plane.c | 2 ++ 8 files changed, 45 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_display_types.h b/drivers/gpu/drm/i915/display/intel_display_types.h index f2918bb07107..a4a57aa24422 100644 --- a/drivers/gpu/drm/i915/display/intel_display_types.h +++ b/drivers/gpu/drm/i915/display/intel_display_types.h @@ -133,7 +133,11 @@ struct intel_fb_view { struct intel_framebuffer { struct drm_framebuffer base; +#ifdef I915 struct intel_frontbuffer *frontbuffer; +#else + atomic_t bits; +#endif /* Params to remap the FB pages and program the plane registers in each view. */ struct intel_fb_view normal_view; @@ -2074,10 +2078,18 @@ static inline u32 intel_plane_ggtt_offset(const struct intel_plane_state *plane_ #endif } +#ifdef I915 static inline struct intel_frontbuffer * to_intel_frontbuffer(struct drm_framebuffer *fb) { return fb ? to_intel_framebuffer(fb)->frontbuffer : NULL; } +#else +static inline struct intel_framebuffer * +to_intel_frontbuffer(struct drm_framebuffer *fb) +{ + return fb ? to_intel_framebuffer(fb) : NULL; +} +#endif #endif /* __INTEL_DISPLAY_TYPES_H__ */ diff --git a/drivers/gpu/drm/i915/display/intel_drrs.c b/drivers/gpu/drm/i915/display/intel_drrs.c index 5b9e3814..3503d112387d 100644 --- a/drivers/gpu/drm/i915/display/intel_drrs.c +++ b/drivers/gpu/drm/i915/display/intel_drrs.c @@ -9,6 +9,7 @@ #include "intel_de.h" #include "intel_display_types.h" #include "intel_drrs.h" +#include "intel_frontbuffer.h" #include "intel_panel.h" /** diff --git a/drivers/gpu/drm/i915/display/intel_fb.c b/drivers/gpu/drm/i915/display/intel_fb.c index 8c357a4098f6..e67c71f9b29d 100644 --- a/drivers/gpu/drm/i915/display/intel_fb.c +++ b/drivers/gpu/drm/i915/display/intel_fb.c @@ -1846,6 +1846,8 @@ static void intel_user_framebuffer_destroy(struct drm_framebuffer *fb) #ifdef I915 if (intel_fb_uses_dpt(fb)) intel_dpt_destroy(intel_fb->dpt_vm); + + intel_frontbuffer_put(intel_fb->frontbuffer); #else if (intel_fb_obj(fb)->flags & XE_BO_CREATE_PINNED_BIT) { struct xe_bo *bo = intel_fb_obj(fb); @@ -1857,8 +1859,6 @@ static void intel_user_framebuffer_destroy(struct drm_framebuffer *fb) } #endif - intel_frontbuffer_put(intel_fb->frontbuffer); - kfree(intel_fb); } @@ -1966,9 +1966,9 @@ int intel_framebuffer_init(struct intel_framebuffer *intel_fb, obj->flags |= XE_BO_SCANOUT_BIT; } ttm_bo_unreserve(>ttm); -#endif atomic_set(_fb->bits, 0); +#endif if (!drm_any_plane_has_format(_priv->drm, mode_cmd->pixel_format, @@ -2085,7 +2085,9 @@ int intel_framebuffer_init(struct intel_framebuffer *intel_fb, return 0; err: +#ifdef I915 intel_frontbuffer_put(intel_fb->frontbuffer); +#endif return ret; } diff --git a/drivers/gpu/drm/i915/display/intel_fbdev.c b/drivers/gpu/drm/i915/display/intel_fbdev.c index 75d8029185f0..2682b26b511f 100644 --- a/drivers/gpu/drm/i915/display/intel_fbdev.c +++ b/drivers/gpu/drm/i915/display/intel_fbdev.c @@ -82,7 +82,7 @@ struct intel_fbdev { static struct intel_frontbuffer *to_frontbuffer(struct intel_fbdev *ifbdev) { - return ifbdev->fb->frontbuffer; + return to_intel_frontbuffer(>fb->base); } static void intel_fbdev_invalidate(struct intel_fbdev *ifbdev) diff --git a/drivers/gpu/drm/i915/display/intel_frontbuffer.c b/drivers/gpu/drm/i915/display/intel_frontbuffer.c index 17a7aa8b28c2..64fe73d2ac4d 100644 --- a/drivers/gpu/drm/i915/display/intel_frontbuffer.c +++ b/drivers/gpu/drm/i915/display/intel_frontbuffer.c @@ -163,11 +163,17 @@ void intel_frontbuffer_flip(struct drm_i915_private *i915, frontbuffer_flush(i915, frontbuffer_bits, ORIGIN_FLIP); } +#ifdef I915 +#define intel_front_obj(front) ((front)->obj) +#else +#define intel_front_obj(front) (front) +#endif + void __intel_fb_invalidate(struct intel_frontbuffer *front,
Re: [Intel-xe] [PATCH v4 0/3] drm/helpers: Make the suballocation manager drm generic
Hey, I can push this to drm-misc-next, I don't think a drm maintainer ack is needed, as long as we have the acks from the amd folk for merging through drm-misc-next. ~Maarten On 2023-02-27 09:11, Thomas Hellström wrote: Daniel, Dave Ack to merge this to drm through drm-misc-next? /Thomas On 2/24/23 10:51, Thomas Hellström wrote: This series (or at least the suballocator helper) is a prerequisite for the new Xe driver. There was an unresolved issue when the series was last up for review, and that was the per allocation aligment. Last message was from Maarten Lankhorst arguing that the larger per-driver alignment used would only incur a small memory cost. This new variant resolves that. The generic suballocator has been tested with the Xe driver, and a kunit test is under development. The amd- and radeon adaptations are only compile-tested. v3: - Remove stale author information (Christian König) - Update Radeon Kconfig (Thomas Hellström) v4: - Avoid 64-bit integer divisions (kernel test robot ) - Use size_t rather than u64 for the managed range. (Thomas) Maarten Lankhorst (3): drm/suballoc: Extract amdgpu_sa.c as generic suballocation helper drm/amd: Convert amdgpu to use suballocation helper. drm/radeon: Use the drm suballocation manager implementation. drivers/gpu/drm/Kconfig | 4 + drivers/gpu/drm/Makefile | 3 + drivers/gpu/drm/amd/amdgpu/Kconfig | 1 + drivers/gpu/drm/amd/amdgpu/amdgpu.h | 26 +- drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c | 5 +- drivers/gpu/drm/amd/amdgpu/amdgpu_object.h | 23 +- drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h | 3 +- drivers/gpu/drm/amd/amdgpu/amdgpu_sa.c | 324 +-- drivers/gpu/drm/drm_suballoc.c | 457 + drivers/gpu/drm/radeon/Kconfig | 1 + drivers/gpu/drm/radeon/radeon.h | 55 +-- drivers/gpu/drm/radeon/radeon_ib.c | 12 +- drivers/gpu/drm/radeon/radeon_object.h | 25 +- drivers/gpu/drm/radeon/radeon_sa.c | 316 ++ drivers/gpu/drm/radeon/radeon_semaphore.c | 4 +- include/drm/drm_suballoc.h | 108 + 16 files changed, 674 insertions(+), 693 deletions(-) create mode 100644 drivers/gpu/drm/drm_suballoc.c create mode 100644 include/drm/drm_suballoc.h
[PULL] drm-misc-next-fixes
Hi Dave and Daniel, Here's the first pull request for v6.4-rc1. Enjoy! ~Maarten drm-misc-next-2023-02-23: drm-misc-next for v6.4-rc1: First pull request to keep the delta from growing too big. UAPI Changes: - Convert rockchip bindings to YAML. - Constify kobj_type structure in dma-buf. - FBDEV cmdline parser fixes, and other small fbdev fixes for mode parsing. Cross-subsystem Changes: - Actually signal the private stub dma-fence. Core Changes: - Fixes to HPD polling. - Assorted small fixes in simpledrm, bridge, accel, shmem-helper, and the selftest of format-helper. - Remove dummy resource when ttm bo is created, and during pipelined gutting. Fix all drivers to accept a NULL ttm_bo->resource. - Handle pinned BO moving prevention in ttm core. - Set drm panel-bridge orientation before connector is registered. - Remove dumb_destroy callback. - Add documentation to GEM_CLOSE, PRIME_HANDLE_TO_FD, PRIME_FD_TO_HANDLE, GETFB2 ioctl's. - Add atomic enable_plane callback, use it in ast, mgag200, tidss. Driver Changes: - Add Radxa 8/10HD, Samsung AMS495QA01 panels. - Fix ivpu compiler errors. - Assorted fixes to drm/panel, malidp, rockchip, ivpu, amdgpu, vgem, nouveau, vc4. - Assorted cleanups, simplifications and fixes to vmwgfx. The following changes since commit aebd8f0c6f8280ba35bc989f4a9ea47469d3589a: Merge v6.2-rc6 into drm-next (2023-01-31 12:23:23 +0100) are available in the Git repository at: git://anongit.freedesktop.org/drm/drm-misc tags/drm-misc-next-2023-02-23 for you to fetch changes up to 95d39a0c64aa529adbff1bdafd391e83ad587602: drm/radeon: handle NULL bo->resource in move callback (2023-02-23 10:29:20 +0100) drm-misc-next for v6.4-rc1: First pull request to keep the delta from growing too big. UAPI Changes: - Convert rockchip bindings to YAML. - Constify kobj_type structure in dma-buf. - FBDEV cmdline parser fixes, and other small fbdev fixes for mode parsing. Cross-subsystem Changes: - Actually signal the private stub dma-fence. Core Changes: - Fixes to HPD polling. - Assorted small fixes in simpledrm, bridge, accel, shmem-helper, and the selftest of format-helper. - Remove dummy resource when ttm bo is created, and during pipelined gutting. Fix all drivers to accept a NULL ttm_bo->resource. - Handle pinned BO moving prevention in ttm core. - Set drm panel-bridge orientation before connector is registered. - Remove dumb_destroy callback. - Add documentation to GEM_CLOSE, PRIME_HANDLE_TO_FD, PRIME_FD_TO_HANDLE, GETFB2 ioctl's. - Add atomic enable_plane callback, use it in ast, mgag200, tidss. Driver Changes: - Add Radxa 8/10HD, Samsung AMS495QA01 panels. - Fix ivpu compiler errors. - Assorted fixes to drm/panel, malidp, rockchip, ivpu, amdgpu, vgem, nouveau, vc4. - Assorted cleanups, simplifications and fixes to vmwgfx. Andrzej Kacprowski (2): accel/ivpu: Fix FW API data alignment issues accel/ivpu: Send VPU_JSM_MSG_CONTEXT_DELETE when deleting context Arnd Bergmann (3): accel/ivpu: PM: remove broken ivpu_dbg() statements accel: fix CONFIG_DRM dependencies accel/ivpu: avoid duplicate assignment Asahi Lina (1): drm/shmem-helper: Fix locking for drm_gem_shmem_get_pages_sgt() Brian Norris (1): drm/rockchip: vop: Quiet always-warning AFBC log Chris Morgan (3): drm: of: Add drm_of_get_dsi_bus helper function dt-bindings: display: panel: Add Samsung AMS495QA01 drm/panel: Add Magnachip D53E6EA8966 Panel Driver Christian König (4): drm/ttm: stop allocating dummy resources during BO creation drm/ttm: stop allocating a dummy resource for pipelined gutting drm/ttm: prevent moving of pinned BOs drm: remove dumb_destroy callback Dan Carpenter (1): drm/simpledrm: Fix an NULL vs IS_ERR() bug Danilo Krummrich (1): dma-buf: actually set signaling bit for private stub fences Deepak R Varma (1): drm/arm/malidp: use sysfs_emit in show function callback Dmitry Baryshkov (2): drm/probe_helper: extract two helper functions drm/probe_helper: sort out poll_running vs poll_enabled Geert Uytterhoeven (1): drivers: Restore alignment and newline in Makefile Jagan Teki (4): dt-bindings: display: panel: jadard,jd9365da-h3: Add Radxa Display 10HD drm: panel: jd9365da-h3: Add Radxa Display 10HD dt-bindings: display: panel: jadard,jd9365da-h3: Add Radxa Display 8HD drm: panel: jd9365da-h3: Add Radxa Display 8HD Jiri Slaby (SUSE) (1): drm/nouveau/kms/nv50: fix nv50_wndw_new_ prototype Johan Jonker (7): dt-bindings: display: rockchip: convert rockchip-lvds.txt to YAML dt-bindings: soc: rockchip: grf: add rockchip,lvds.yaml dt-bindings: display: dsi-controller: move clock-master property dt-bindings: display: bridge: snps,dw-mipi-dsi: fix clock properties dt-bindings:
Re: Question: partial transfers of DMABUFs
On 2023-02-15 13:00, Paul Cercueil wrote: Hi Maarten, Le mercredi 15 février 2023 à 12:52 +0100, Maarten Lankhorst a écrit : Hey, On 2023-02-15 12:47, Paul Cercueil wrote: Hi Maarten, Le mercredi 15 février 2023 à 12:30 +0100, Maarten Lankhorst a écrit : Hey, On 2023-02-15 11:48, Paul Cercueil wrote: Hi, I am working on adding support for DMABUFs in the IIO subsystem. One thing we want there, is the ability to specify the number of bytes to transfer (while still defaulting to the DMABUF size). Since dma_buf_map_attachment() returns a sg_table, I basically have two options, and I can't decide which one is the best (or the less ugly): - Either I add a new API function similar to dmaengine_prep_slave_sg(), which still takes a scatterlist as argument but also takes the number of bytes as argument; - Or I add a function to duplicate the scatterlist and then shrink it manually, which doesn't sound like a good idea either. What would be the recommended way? Does this need an api change? If you create a DMA-BUF of size X, it has to be of size X. You can pad with a dummy page probably if you know it in advance. But after it has been imported, it cannot change size. Yes, the sizes are fixed. You don´t have to write the entire dma-buf either, so if you want to create a 1GB buf and only use the first 4K, that is allowed. The contents of the remainder of the DMA-BUF are undefined. It's up to userspace to assign a meaning to it. I think I'm missing something here that makes the whole question m,ake more sense. I want my userspace to be able to specify how much of the DMABUF is to be read from or written to. So in my new "dmabuf enqueue" IOCTL that I want to add to IIO, I added a parameter to specify the number of bytes to transfer (where 0 means the whole buffer). The problem I have now, is that the current dmaengine core does not have a API function that takes a scatterlist (returned by dma_map_attachment()) and a transfer size in bytes, it will always transfer the whole scatterlist. So my two options would be to add a new API function to support specifying a bytes count, or add a mechanism to duplicate a scatterlist, so that I can tweak it to the right size. This doesn't have to happen through DMA-BUF. Presumably you are both the importer and the exporter, so after you know how much is read, you can tell this to the importer that X number of bytes can be read from DMA-BUF Y. Yes, I do that already as it is an argument in my ioctl. In your case, when enqueing you will get a full SG list, but if you know only X bytes are read/written you only have to map the first X bytes to your IIO device. The rest of the SG list could be ignored safely. Yes. But I don't know how to "ignore the rest of the SG list". - dma_buf_map_attachment() does not have a parameter to specify that I only need the first X bytes mapped; - if I map the whole thing, dmaengine_prep_slave_sg() does not have an option to specify that I only want the first X bytes transferred. sg_split apppears to allow you to split it? I'm not 100% sure whether it leaves the original SG untouched, but you can try to put it in between those 2 calls to get a smaller SG to pass to prep_slave_sg. ~Maarten
Re: Question: partial transfers of DMABUFs
Hey, On 2023-02-15 12:47, Paul Cercueil wrote: Hi Maarten, Le mercredi 15 février 2023 à 12:30 +0100, Maarten Lankhorst a écrit : Hey, On 2023-02-15 11:48, Paul Cercueil wrote: Hi, I am working on adding support for DMABUFs in the IIO subsystem. One thing we want there, is the ability to specify the number of bytes to transfer (while still defaulting to the DMABUF size). Since dma_buf_map_attachment() returns a sg_table, I basically have two options, and I can't decide which one is the best (or the less ugly): - Either I add a new API function similar to dmaengine_prep_slave_sg(), which still takes a scatterlist as argument but also takes the number of bytes as argument; - Or I add a function to duplicate the scatterlist and then shrink it manually, which doesn't sound like a good idea either. What would be the recommended way? Does this need an api change? If you create a DMA-BUF of size X, it has to be of size X. You can pad with a dummy page probably if you know it in advance. But after it has been imported, it cannot change size. Yes, the sizes are fixed. You don´t have to write the entire dma-buf either, so if you want to create a 1GB buf and only use the first 4K, that is allowed. The contents of the remainder of the DMA-BUF are undefined. It's up to userspace to assign a meaning to it. I think I'm missing something here that makes the whole question m,ake more sense. I want my userspace to be able to specify how much of the DMABUF is to be read from or written to. So in my new "dmabuf enqueue" IOCTL that I want to add to IIO, I added a parameter to specify the number of bytes to transfer (where 0 means the whole buffer). The problem I have now, is that the current dmaengine core does not have a API function that takes a scatterlist (returned by dma_map_attachment()) and a transfer size in bytes, it will always transfer the whole scatterlist. So my two options would be to add a new API function to support specifying a bytes count, or add a mechanism to duplicate a scatterlist, so that I can tweak it to the right size. This doesn't have to happen through DMA-BUF. Presumably you are both the importer and the exporter, so after you know how much is read, you can tell this to the importer that X number of bytes can be read from DMA-BUF Y. In your case, when enqueing you will get a full SG list, but if you know only X bytes are read/written you only have to map the first X bytes to your IIO device. The rest of the SG list could be ignored safely. ~Maarten
Re: Question: partial transfers of DMABUFs
Hey, On 2023-02-15 11:48, Paul Cercueil wrote: Hi, I am working on adding support for DMABUFs in the IIO subsystem. One thing we want there, is the ability to specify the number of bytes to transfer (while still defaulting to the DMABUF size). Since dma_buf_map_attachment() returns a sg_table, I basically have two options, and I can't decide which one is the best (or the less ugly): - Either I add a new API function similar to dmaengine_prep_slave_sg(), which still takes a scatterlist as argument but also takes the number of bytes as argument; - Or I add a function to duplicate the scatterlist and then shrink it manually, which doesn't sound like a good idea either. What would be the recommended way? Does this need an api change? If you create a DMA-BUF of size X, it has to be of size X. You can pad with a dummy page probably if you know it in advance. But after it has been imported, it cannot change size. You don´t have to write the entire dma-buf either, so if you want to create a 1GB buf and only use the first 4K, that is allowed. The contents of the remainder of the DMA-BUF are undefined. It's up to userspace to assign a meaning to it. I think I'm missing something here that makes the whole question m,ake more sense. ~Maarten
Re: RFC: dma_resv_unlock() and ww_acquire_ctx scope
On 2023-01-19 11:24, Paul Cercueil wrote: Hi, Just a reflexion I have after an intensive (and intense) debugging session. I had the following code: int my_dma_resv_lock(struct dma_buf *dmabuf) { struct ww_acquire_ctx ctx; int ret; ww_acquire_init(, _ww_class); ret = dma_resv_lock_interruptible(dmabuf->resv, ); if (ret) { if (ret != -EDEADLK) return ret; ret = dma_resv_lock_slow_interruptible(dmabuf->resv, ); } return ret; } Then I would eventually unlock the dma_resv object in the caller function. What made me think this was okay, was that the API itself suggests it's okay - as dma_resv_unlock() does not take the "ww_acquire_ctx" object as argument, my assumption was that after the dma_resv was locked, the variable could go out of scope. I wonder if it would be possible to change the API a little bit, so that it is less prone to errors like this. Maybe by doing a struct copy of the initialized ctx into the dma_resv object (if at all possible), so that the original can actually go out of scope, or maybe having dma_resv_unlock() take the ww_acquire_ctx as argument, even if it is not actually used in the function body - just to make it obvious that it is needed all the way to the point where the dma_resv is unlocked. This email doesn't have to result in anything, I just thought I'd share one point where I feel the API could be made less error-prone. Hey, This example code will fail eventually. If you have DEBUG_LOCK_ALLOC enabled, a fake lock is inited in ww_acquire_init. If you don't free it using ww_acquire_fini(), lockdep will see that you free a live lock that was never released. PROVE_LOCKING will also complain that you never unlocked the ctx fake lock. If you do call ww_acquire_fini, you will get a loud complain if you never released all locks, because ctx->acquired is non-zero. Try with PROVE_LOCKING, your example will receive a lockdep splat. :) ~Maarten
[PULL] drm-misc-fixes
Hey Dave, drm-misc-fixes for v6.1 final. A bit late, hopefully just in time. drm-misc-fixes-2022-12-08: drm-misc-fixes for v6.1 final?: - Fix polarity bug in bridge/ti-sn65dsi86. - Prefer 8-bit RGB fallback before any YUV mode in dw-hdmi, since some panels lie about YUV support. - Fixes to shmem-helper error paths. - Small vmwgfx to stop using screen objects when SEV is active. The following changes since commit a6a00d7e8ffd78d1cdb7a43f1278f081038c638f: fbcon: Use kzalloc() in fbcon_prepare_logo() (2022-11-22 15:48:02 +0100) are available in the Git repository at: git://anongit.freedesktop.org/drm/drm-misc tags/drm-misc-fixes-2022-12-08 for you to fetch changes up to 6e90293618ed476d6b11f82ce724efbb9e9a071b: drm/vmwgfx: Don't use screen objects when SEV is active (2022-12-05 13:59:38 -0500) drm-misc-fixes for v6.1 final?: - Fix polarity bug in bridge/ti-sn65dsi86. - Prefer 8-bit RGB fallback before any YUV mode in dw-hdmi, since some panels lie about YUV support. - Fixes to shmem-helper error paths. - Small vmwgfx to stop using screen objects when SEV is active. Dawei Li (1): drm/vmwgfx: Fix race issue calling pin_user_pages Guillaume BRUN (1): drm: bridge: dw_hdmi: fix preference of RGB modes over YUV420 Qiqi Zhang (1): drm/bridge: ti-sn65dsi86: Fix output polarity setting bug Rob Clark (2): drm/shmem-helper: Remove errant put in error path drm/shmem-helper: Avoid vm_open error paths Zack Rusin (1): drm/vmwgfx: Don't use screen objects when SEV is active drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 6 +++--- drivers/gpu/drm/bridge/ti-sn65dsi86.c | 4 ++-- drivers/gpu/drm/drm_gem_shmem_helper.c| 18 -- drivers/gpu/drm/vmwgfx/vmwgfx_msg.c | 6 +++--- drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c | 4 5 files changed, 24 insertions(+), 14 deletions(-)
[PULL] drm-misc-fixes
Hey Daniel and Dave, A single fix to vmwgfx mks-guest-stats ioctl. I lost my internet connection when pushing the tag, so I put together this mail manually. I hope you remember where drm-misc is hosted. :) Enjoy! Maarten Lankhorst drm-misc-fixes-2022-11-30: drm-misc-fixes for v6.1-rc8/final: - Single fix for mks-guest-stats ioctl userpages pinning. Dawei Li (1): drm/vmwgfx: Fix race issue calling pin_user_pages drivers/gpu/drm/vmwgfx/vmwgfx_msg.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
[PULL] drm-misc-fixes
Hey Daniel and Dae, Not much here, a few fixes to dma-fence handling and a fix to amdgpu and logo. Enjoy! Maarten Lankhorst drm-misc-fixes-2022-11-24: drm-misc-fixes for v6.1-rc7: - Another amdgpu gang submit fix. - Use dma_fence_unwrap_for_each when importing sync files. - Fix race in dma_heap_add(). - Fix use of uninitialized memory in logo. The following changes since commit 5954acbacbd1946b96ce8ee799d309cb0cd3cb9d: drm/display: Don't assume dual mode adaptors support i2c sub-addressing (2022-11-15 23:31:02 +0200) are available in the Git repository at: git://anongit.freedesktop.org/drm/drm-misc tags/drm-misc-fixes-2022-11-24 for you to fetch changes up to a6a00d7e8ffd78d1cdb7a43f1278f081038c638f: fbcon: Use kzalloc() in fbcon_prepare_logo() (2022-11-22 15:48:02 +0100) drm-misc-fixes for v6.1-rc7: - Another amdgpu gang submit fix. - Use dma_fence_unwrap_for_each when importing sync files. - Fix race in dma_heap_add(). - Fix use of uninitialized memory in logo. Christian König (1): drm/amdgpu: handle gang submit before VMID Dawei Li (1): dma-buf: fix racing conflict of dma_heap_add() Jason Ekstrand (1): dma-buf: Use dma_fence_unwrap_for_each when importing fences Tetsuo Handa (1): fbcon: Use kzalloc() in fbcon_prepare_logo() drivers/dma-buf/dma-buf.c | 23 +-- drivers/dma-buf/dma-heap.c | 28 +++- drivers/gpu/drm/amd/amdgpu/amdgpu_job.c | 6 +++--- drivers/video/fbdev/core/fbcon.c| 2 +- 4 files changed, 36 insertions(+), 23 deletions(-)
[PULL] drm-misc-fixes
Hi Dave, Daniel, A few fixes for v6.1-rc6. Most important one apears to be reverting a change that breaks DP-MST. drm-misc-fixes-2022-11-17: drm-misc-fixes for v6.1-rc6: - Fix error handling in vc4_atomic_commit_tail() - Set bpc for logictechno panels. - Fix potential memory leak in drm_dev_init() - Fix potential null-ptr-deref in drm_vblank_destroy_worker() - Set lima's clkname corrrectly when regulator is missing. - Small amdgpu fix to gang submission. - Revert hiding unregistered connectors from userspace, as it breaks on DP-MST. - Add workaround for DP++ dual mode adaptors that don't support i2c subaddressing. The following changes since commit f352262f727215553879705bacbcb208979f3eff: drm/panfrost: Split io-pgtable requests properly (2022-11-09 14:17:39 +) are available in the Git repository at: git://anongit.freedesktop.org/drm/drm-misc tags/drm-misc-fixes-2022-11-17 for you to fetch changes up to 5954acbacbd1946b96ce8ee799d309cb0cd3cb9d: drm/display: Don't assume dual mode adaptors support i2c sub-addressing (2022-11-15 23:31:02 +0200) drm-misc-fixes for v6.1-rc6: - Fix error handling in vc4_atomic_commit_tail() - Set bpc for logictechno panels. - Fix potential memory leak in drm_dev_init() - Fix potential null-ptr-deref in drm_vblank_destroy_worker() - Set lima's clkname corrrectly when regulator is missing. - Small amdgpu fix to gang submission. - Revert hiding unregistered connectors from userspace, as it breaks on DP-MST. - Add workaround for DP++ dual mode adaptors that don't support i2c subaddressing. Aishwarya Kothari (1): drm/panel: simple: set bpc field for logic technologies displays Christian König (1): drm/amdgpu: use the last IB as gang leader v2 Erico Nunes (1): drm/lima: Fix opp clkname setting in case of missing regulator Gaosheng Cui (1): drm/vc4: kms: Fix IS_ERR() vs NULL check for vc4_kms Shang XiaoJing (2): drm/drv: Fix potential memory leak in drm_dev_init() drm: Fix potential null-ptr-deref in drm_vblank_destroy_worker() Simon Rettberg (1): drm/display: Don't assume dual mode adaptors support i2c sub-addressing Simon Ser (1): Revert "drm: hide unregistered connectors from GETCONNECTOR IOCTL" drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c| 23 ++ drivers/gpu/drm/amd/amdgpu/amdgpu_cs.h| 1 + drivers/gpu/drm/display/drm_dp_dual_mode_helper.c | 51 +-- drivers/gpu/drm/drm_drv.c | 2 +- drivers/gpu/drm/drm_internal.h| 3 +- drivers/gpu/drm/drm_mode_config.c | 3 -- drivers/gpu/drm/lima/lima_devfreq.c | 15 --- drivers/gpu/drm/panel/panel-simple.c | 2 + drivers/gpu/drm/vc4/vc4_kms.c | 8 ++-- 9 files changed, 64 insertions(+), 44 deletions(-)
[PULL] drm-misc-fixes
Hey Daniel & Dave, Another small pull request. Various small assorted fixes. drm-misc-fixes-2022-11-09: drm-misc-fixes for v6.1-rc5: - HDMI fixes to vc4. - Make panfrost's uapi header compile with C++. - Add rotation quirks for 2 panels. - Fix s/r in amdgpu_vram_mgr_new - Handle 1 gb boundary correctly in panfrost mmu code. The following changes since commit fc007fb815ab5395c3962c09b79a1630b0fbed9c: drm/imx: imx-tve: Fix return type of imx_tve_connector_mode_valid (2022-11-01 14:36:55 +0100) are available in the Git repository at: git://anongit.freedesktop.org/drm/drm-misc tags/drm-misc-fixes-2022-11-09 for you to fetch changes up to f352262f727215553879705bacbcb208979f3eff: drm/panfrost: Split io-pgtable requests properly (2022-11-09 14:17:39 +) drm-misc-fixes for v6.1-rc5: - HDMI fixes to vc4. - Make panfrost's uapi header compile with C++. - Add rotation quirks for 2 panels. - Fix s/r in amdgpu_vram_mgr_new - Handle 1 gb boundary correctly in panfrost mmu code. Hans de Goede (2): drm: panel-orientation-quirks: Add quirk for Nanote UMPC-01 drm: panel-orientation-quirks: Add quirk for Acer Switch V 10 (SW5-017) Ma Jun (1): drm/amdgpu: Fix the lpfn checking condition in drm buddy Robin Murphy (1): drm/panfrost: Split io-pgtable requests properly Steven Price (1): drm/panfrost: Remove type name from internal struct again Yuan Can (1): drm/vc4: Fix missing platform_unregister_drivers() call in vc4_drm_register() max...@cerno.tech (3): drm/vc4: hdmi: Take our lock to reset the link drm/vc4: hdmi: Fix outdated function name in comment drm/vc4: hdmi: Fix HSM clock too low on Pi4 drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c | 2 +- drivers/gpu/drm/drm_panel_orientation_quirks.c | 12 +++ drivers/gpu/drm/panfrost/panfrost_mmu.c | 11 +- drivers/gpu/drm/vc4/vc4_drv.c | 7 +++- drivers/gpu/drm/vc4/vc4_hdmi.c | 47 -- drivers/gpu/drm/vc4/vc4_hdmi.h | 1 + include/uapi/drm/panfrost_drm.h | 2 +- 7 files changed, 67 insertions(+), 15 deletions(-)
[PULL] drm-misc-fixes
I had a massive disk crash, and my pull request is unsigned this one time. However, it is signed with the promise the next tag will be signed again! - drm-misc-fixes-2022-11-02-1: drm-misc-fixes for v6.1-rc4: - Small fixes to make rockchip work better. - Fix imx Kconfig. - Small fix to imx' mode_valid. The following changes since commit e0ba1a39b8dfe4f005bebdd85daa89e7382e26b7: fbdev/core: Avoid uninitialized read in aperture_remove_conflicting_pci_device() (2022-10-27 09:20:05 +0200) are available in the Git repository at: git://anongit.freedesktop.org/drm/drm-misc tags/drm-misc-fixes-2022-11-02-1 for you to fetch changes up to fc007fb815ab5395c3962c09b79a1630b0fbed9c: drm/imx: imx-tve: Fix return type of imx_tve_connector_mode_valid (2022-11-01 14:36:55 +0100) drm-misc-fixes for v6.1-rc4: - Small fixes to make rockchip work better. - Fix imx Kconfig. - Small fix to imx' mode_valid. Aurelien Jarno (1): drm/rockchip: dw_hdmi: filter regulator -EPROBE_DEFER error messages Brian Norris (2): drm/rockchip: dsi: Clean up 'usage_mode' when failing to attach drm/rockchip: dsi: Force synchronous probe Hector Martin (1): drm/format-helper: Only advertise supported formats for conversion John Keeping (1): drm/rockchip: fix fbdev on non-IOMMU devices Liu Ying (1): drm/imx: Kconfig: Remove duplicated 'select DRM_KMS_HELPER' line Michael Tretter (2): drm/rockchip: vop2: fix null pointer in plane_atomic_disable drm/rockchip: vop2: disable planes when disabling the crtc Nathan Huckleberry (1): drm/imx: imx-tve: Fix return type of imx_tve_connector_mode_valid Ondrej Jirman (1): drm/rockchip: dsi: Fix VOP selection on SoCs that support it drivers/gpu/drm/drm_format_helper.c | 66 ++--- drivers/gpu/drm/imx/Kconfig | 1 - drivers/gpu/drm/imx/imx-tve.c | 5 +- drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c | 26 +++--- drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c | 3 +- drivers/gpu/drm/rockchip/rockchip_drm_gem.c | 5 +- drivers/gpu/drm/rockchip/rockchip_drm_vop2.c| 10 +++- 7 files changed, 83 insertions(+), 33 deletions(-)
[PULL] drm-misc-fixes
drm-misc-fixes-2022-10-27: drm-misc-fixes for v6.1-rc3: - Fix HPD on bridge/ps8640. - Stop leaking fences when killing a sched entity. - Avoid uninitialized read in aperture_remove_conflicting_pci_device() The following changes since commit 247f34f7b80357943234f93f247a1ae6b6c3a740: Linux 6.1-rc2 (2022-10-23 15:27:33 -0700) are available in the Git repository at: git://anongit.freedesktop.org/drm/drm-misc tags/drm-misc-fixes-2022-10-27 for you to fetch changes up to e0ba1a39b8dfe4f005bebdd85daa89e7382e26b7: fbdev/core: Avoid uninitialized read in aperture_remove_conflicting_pci_device() (2022-10-27 09:20:05 +0200) drm-misc-fixes for v6.1-rc3: - Fix HPD on bridge/ps8640. - Stop leaking fences when killing a sched entity. - Avoid uninitialized read in aperture_remove_conflicting_pci_device() Christian König (1): drm/scheduler: fix fence ref counting Douglas Anderson (1): drm/bridge: ps8640: Add back the 50 ms mystery delay after HPD Maarten Lankhorst (1): Merge remote-tracking branch 'drm/drm-fixes' into drm-misc-fixes Michał Mirosław (1): fbdev/core: Avoid uninitialized read in aperture_remove_conflicting_pci_device() drivers/gpu/drm/bridge/parade-ps8640.c | 25 +++-- drivers/gpu/drm/scheduler/sched_entity.c | 6 +- drivers/video/aperture.c | 5 + 3 files changed, 29 insertions(+), 7 deletions(-)
[PULL] drm-misc-fixes
drm-misc-fixes-2022-10-20: drm-misc-fixes for v6.1-rc2: - Fix a buffer overflow in format_helper_test. - Set DDC pointer in drmm_connector_init. - Compiler fixes for panfrost. The following changes since commit 9abf2313adc1ca1b6180c508c25f22f9395cc780: Linux 6.1-rc1 (2022-10-16 15:36:24 -0700) are available in the Git repository at: git://anongit.freedesktop.org/drm/drm-misc tags/drm-misc-fixes-2022-10-20 for you to fetch changes up to 72655fb942c1e3d9e71e48e87ee439abe52f3a90: drm/panfrost: replace endian-specific types with native ones (2022-10-20 11:02:11 +0100) drm-misc-fixes for v6.1-rc2: - Fix a buffer overflow in format_helper_test. - Set DDC pointer in drmm_connector_init. - Compiler fixes for panfrost. Christian König (2): drm/sched: add DRM_SCHED_FENCE_DONT_PIPELINE flag drm/amdgpu: use DRM_SCHED_FENCE_DONT_PIPELINE for VM updates David Gow (1): drm: tests: Fix a buffer overflow in format_helper_test Maxime Ripard (4): drm/vc4: Add module dependency on hdmi-codec drm/vc4: hdmi: Enforce the minimum rate at runtime_resume drm/vc4: hdmi: Check the HSM rate at runtime_resume drm/connector: Set DDC pointer in drmm_connector_init Steven Price (2): drm/panfrost: Remove type name from internal structs drm/panfrost: replace endian-specific types with native ones Thomas Zimmermann (1): Merge drm/drm-fixes into drm-misc-fixes drivers/gpu/drm/amd/amdgpu/amdgpu_vm_sdma.c| 9 ++- drivers/gpu/drm/drm_connector.c| 2 +- drivers/gpu/drm/panfrost/panfrost_dump.c | 36 +- drivers/gpu/drm/scheduler/sched_entity.c | 3 ++- drivers/gpu/drm/tests/drm_format_helper_test.c | 2 +- drivers/gpu/drm/vc4/vc4_drv.c | 1 + drivers/gpu/drm/vc4/vc4_hdmi.c | 29 + include/drm/gpu_scheduler.h| 9 +++ include/uapi/drm/panfrost_drm.h| 36 ++ 9 files changed, 89 insertions(+), 38 deletions(-)
[PULL] drm-misc-next
Small final pull request for v6.1, if still before deadline! drm-misc-next-2022-09-30: drm-misc-next for v6.1: Core Changes: - Add dma_resv_assert_held to vmap/vunmap calls. - Add kunit tests for some format conversion calls. - Don't rewrite link config when setting phy test pattern in DP link training. Driver Changes: - Assorted small fixes in bridge/lt8192b, qxl, virtio-gpu, ast. - Fix corrupted image output in lt8912b. - Fix driver unbind in meson. - Add INX, BOE, AUO, Multi-Inno Technology panels to panel-edp. - Synchronize access to GEM bo's in simpledrm, ssd130x. - Use dev_err_probe in panel-edp and panel-simple. The following changes since commit 39dd0cc2e5bd0d5188dd69f27e18783cea7ff06a: drm/amdgpu: Fix VRAM eviction issue (2022-09-22 19:53:06 +0200) are available in the Git repository at: git://anongit.freedesktop.org/drm/drm-misc tags/drm-misc-next-2022-09-30 for you to fetch changes up to c9b48b91e2fbb74fb981aa616a6ef3c78194077f: drm/panel: simple: Use dev_err_probe() to simplify code (2022-09-29 14:04:25 -0700) drm-misc-next for v6.1: Core Changes: - Add dma_resv_assert_held to vmap/vunmap calls. - Add kunit tests for some format conversion calls. - Don't rewrite link config when setting phy test pattern in DP link training. Driver Changes: - Assorted small fixes in bridge/lt8192b, qxl, virtio-gpu, ast. - Fix corrupted image output in lt8912b. - Fix driver unbind in meson. - Add INX, BOE, AUO, Multi-Inno Technology panels to panel-edp. - Synchronize access to GEM bo's in simpledrm, ssd130x. - Use dev_err_probe in panel-edp and panel-simple. Adrián Larumbe (3): drm/meson: reorder driver deinit sequence to fix use-after-free bug drm/meson: explicitly remove aggregate driver at module unload time drm/meson: remove drm bridges at aggregate driver unbind time Christian König (1): drm/ttm: add dma_resv_assert_held() calls to vmap/vunmap Christoph Niedermaier (2): dt-bindings: display: simple: Add Multi-Inno Technology MI0800FT-9 panel drm/panel: simple: Add Multi-Inno Technology MI0800FT-9 Dan Carpenter (1): virtio-gpu: fix shift wrapping bug in virtio_gpu_fence_event_create() Francesco Dolcini (2): drm/bridge: lt8912b: clarify lvds output status drm/bridge: lt8912b: fix corrupted image output Javier Martinez Canillas (2): drm/ssd130x: Use drm_atomic_get_new_plane_state() drm/ssd130x: Synchronize access to dma-buf imported GEM BOs José Expósito (3): drm/format-helper: Add KUnit tests for drm_fb_xrgb_to_rgb888() drm/format-helper: Add KUnit tests for drm_fb_xrgb_to_xrgb2101010() drm/format-helper: Add KUnit tests for drm_fb_xrgb_to_gray8() Khaled Almahallawy (1): drm/dp: Don't rewrite link config when setting phy test pattern Philippe Schenker (2): drm/bridge: lt8912b: add vsync hsync drm/bridge: lt8912b: set hdmi or dvi mode Sean Hong (8): drm/panel-edp: Add INX N116BCN-EA1 drm/panel-edp: Add BOE NT116WHM-N21 (HW: V8.1) drm/panel-edp: Add BOE NT116WHM-N21 drm/panel-edp: Add AUO B116XAK01.6 drm/panel-edp: Add INX N116BCA-EA2 drm/panel-edp: Fix delays for INX N116BCN-EA1 (HW: C4) drm/panel-edp: Fix delays for INX N116BCA-EA2 (HW: C1) drm/panel-edp: Add BOE NT116WHM-N4C (HW: V8.1) Simon Ser (1): drm/framebuffer: convert to drm_dbg_kms() Thomas Zimmermann (5): drm/simpledrm: Compute linestride with drm_format_info_min_pitch() drm/simpledrm: Use drm_atomic_get_new_plane_state() drm/simpledrm: Remove !fb check from atomic_update drm/simpledrm: Iterate over damage clips drm/simpledrm: Synchronize access to GEM BOs Yuan Can (2): drm/panel: panel-edp: Use dev_err_probe() to simplify code drm/panel: simple: Use dev_err_probe() to simplify code Zongmin Zhou (1): drm/qxl: drop set_prod_notify parameter from qxl_ring_create ruanjinjie (1): drm/ast: make ast_modeset static .../bindings/display/panel/panel-simple.yaml | 2 + drivers/gpu/drm/ast/ast_drv.c | 2 +- drivers/gpu/drm/bridge/lontium-lt8912b.c | 39 +++-- drivers/gpu/drm/display/drm_dp_helper.c| 9 - drivers/gpu/drm/drm_format_helper.c| 1 + drivers/gpu/drm/drm_framebuffer.c | 66 +++ drivers/gpu/drm/meson/meson_drv.c | 14 +- drivers/gpu/drm/meson/meson_drv.h | 7 + drivers/gpu/drm/meson/meson_encoder_cvbs.c | 13 ++ drivers/gpu/drm/meson/meson_encoder_cvbs.h | 1 + drivers/gpu/drm/meson/meson_encoder_hdmi.c | 13 ++ drivers/gpu/drm/meson/meson_encoder_hdmi.h | 1 + drivers/gpu/drm/panel/panel-edp.c | 28 ++- drivers/gpu/drm/panel/panel-simple.c | 42 -
Re: [PATCH 1/4] drm: Add missing DP DSC extended capability definitions.
Op 14-09-2022 om 12:28 schreef Jani Nikula: > On Tue, 13 Sep 2022, Stanislav Lisovskiy > wrote: >> Adding DP DSC register definitions, we might need for further >> DSC implementation, supporting MST and DP branch pass-through mode. >> >> v2: - Fixed checkpatch comment warning >> v3: - Removed function which is not yet used(Jani Nikula) >> >> Reviewed-by: Vinod Govindapillai >> >> Signed-off-by: Stanislav Lisovskiy > Maarten, Maxime, Thomas - > > Retry, can we get an ack for merging this one via drm-intel-next? > > Thanks, > Jani. Acked-by: Maarten Lankhorst > >> --- >> include/drm/display/drm_dp.h | 9 - >> 1 file changed, 8 insertions(+), 1 deletion(-) >> >> diff --git a/include/drm/display/drm_dp.h b/include/drm/display/drm_dp.h >> index e934aab357be..9bc22a02874d 100644 >> --- a/include/drm/display/drm_dp.h >> +++ b/include/drm/display/drm_dp.h >> @@ -240,6 +240,8 @@ >> #define DP_DSC_SUPPORT 0x060 /* DP 1.4 */ >> # define DP_DSC_DECOMPRESSION_IS_SUPPORTED (1 << 0) >> # define DP_DSC_PASSTHROUGH_IS_SUPPORTED(1 << 1) >> +# define DP_DSC_DYNAMIC_PPS_UPDATE_SUPPORT_COMP_TO_COMP(1 << 2) >> +# define DP_DSC_DYNAMIC_PPS_UPDATE_SUPPORT_UNCOMP_TO_COMP (1 << 3) >> >> #define DP_DSC_REV 0x061 >> # define DP_DSC_MAJOR_MASK (0xf << 0) >> @@ -278,12 +280,15 @@ >> >> #define DP_DSC_BLK_PREDICTION_SUPPORT 0x066 >> # define DP_DSC_BLK_PREDICTION_IS_SUPPORTED (1 << 0) >> +# define DP_DSC_RGB_COLOR_CONV_BYPASS_SUPPORT (1 << 1) >> >> #define DP_DSC_MAX_BITS_PER_PIXEL_LOW 0x067 /* eDP 1.4 */ >> >> #define DP_DSC_MAX_BITS_PER_PIXEL_HI0x068 /* eDP 1.4 */ >> # define DP_DSC_MAX_BITS_PER_PIXEL_HI_MASK (0x3 << 0) >> # define DP_DSC_MAX_BITS_PER_PIXEL_HI_SHIFT 8 >> +# define DP_DSC_MAX_BPP_DELTA_VERSION_MASK 0x06 >> +# define DP_DSC_MAX_BPP_DELTA_AVAILABILITY 0x08 >> >> #define DP_DSC_DEC_COLOR_FORMAT_CAP 0x069 >> # define DP_DSC_RGB (1 << 0) >> @@ -345,11 +350,13 @@ >> # define DP_DSC_24_PER_DP_DSC_SINK (1 << 2) >> >> #define DP_DSC_BITS_PER_PIXEL_INC 0x06F >> +# define DP_DSC_RGB_YCbCr444_MAX_BPP_DELTA_MASK 0x1f >> +# define DP_DSC_RGB_YCbCr420_MAX_BPP_DELTA_MASK 0xe0 >> # define DP_DSC_BITS_PER_PIXEL_1_16 0x0 >> # define DP_DSC_BITS_PER_PIXEL_1_8 0x1 >> # define DP_DSC_BITS_PER_PIXEL_1_4 0x2 >> # define DP_DSC_BITS_PER_PIXEL_1_2 0x3 >> -# define DP_DSC_BITS_PER_PIXEL_10x4 >> +# define DP_DSC_BITS_PER_PIXEL_1_1 0x4 >> >> #define DP_PSR_SUPPORT 0x070 /* XXX 1.2? */ >> # define DP_PSR_IS_SUPPORTED1
[PULL] drm-misc-next
Hello Dave, Daniel, Another pull request for drm-misc-next, enjoy! ~Maarten drm-misc-next-2022-09-09: drm-misc-next for v6.1-rc1: UAPI Changes: - Hide unregistered connectors from GETCONNECTOR ioctl. - drm/virtio no longer advertises LINEAR modifier, as it doesn't work. - Cross-subsystem Changes: - Fix GPF in udmabuf failure path. Core Changes: - Rework TTM placement to use intersect/compatible functions. - Drop legacy DP-MST support. - More DP-MST related fixes, and move all state into atomic. - Make DRM_MIPI_DBI select DRM_KMS_HELPER. - Add audio_infoframe packing for DP. - Add logging when some atomic check functions fail. - Assorted documentation updates and fixes. Driver Changes: - Assorted cleanups and fixes in msm, lcdif, nouveau, virtio, panel/ilitek, bridge/icn6211, tve200, gma500, bridge/*, panfrost, via, bochs, qxl, sun4i. - Add add AUO B133UAN02.1, IVO M133NW4J-R3, Innolux N120ACA-EA1 eDP panels. - Improve DP-MST modeset state handling in amdgpu, nouveau, i915. - Drop DP-MST from radeon driver, it was broken and only user of legacy DP-MST. - Handle unplugging better in vc4. - Simplify drm cmdparser tests. - Add DP support to ti-sn65dsi86. - Add MT8195 DP support to mediatek. - Support RGB565, XRGB64, and ARGB64 formats in vkms. - Convert sun4i tv support to atomic. - Refactor vc4/vec TV Modesetting, and fix timings. - Use atomic helpers instead of simple display helpers in ssd130x. Maintainer changes: - Add Douglas Anderson as reviewer for panel-edp. The following changes since commit 8869fa666a9e6782c3c896c1fa57d65adca23249: drm/virtio: remove drm_plane_cleanup() destroy hook (2022-08-19 16:00:15 +0200) are available in the Git repository at: git://anongit.freedesktop.org/drm/drm-misc tags/drm-misc-next-2022-09-09 for you to fetch changes up to 5d832b6694e094b176627ed9918a1b21c56fb742: drm/dp_mst: Avoid deleting payloads for connectors staying enabled (2022-09-08 19:41:18 +0300) drm-misc-next for v6.1-rc1: UAPI Changes: - Hide unregistered connectors from GETCONNECTOR ioctl. - drm/virtio no longer advertises LINEAR modifier, as it doesn't work. - Cross-subsystem Changes: - Fix GPF in udmabuf failure path. Core Changes: - Rework TTM placement to use intersect/compatible functions. - Drop legacy DP-MST support. - More DP-MST related fixes, and move all state into atomic. - Make DRM_MIPI_DBI select DRM_KMS_HELPER. - Add audio_infoframe packing for DP. - Add logging when some atomic check functions fail. - Assorted documentation updates and fixes. Driver Changes: - Assorted cleanups and fixes in msm, lcdif, nouveau, virtio, panel/ilitek, bridge/icn6211, tve200, gma500, bridge/*, panfrost, via, bochs, qxl, sun4i. - Add add AUO B133UAN02.1, IVO M133NW4J-R3, Innolux N120ACA-EA1 eDP panels. - Improve DP-MST modeset state handling in amdgpu, nouveau, i915. - Drop DP-MST from radeon driver, it was broken and only user of legacy DP-MST. - Handle unplugging better in vc4. - Simplify drm cmdparser tests. - Add DP support to ti-sn65dsi86. - Add MT8195 DP support to mediatek. - Support RGB565, XRGB64, and ARGB64 formats in vkms. - Convert sun4i tv support to atomic. - Refactor vc4/vec TV Modesetting, and fix timings. - Use atomic helpers instead of simple display helpers in ssd130x. Maintainer changes: - Add Douglas Anderson as reviewer for panel-edp. Alisa Khabibrakhmanova (1): drm/via: Add new condition to via_dma_cleanup() Arunpravin Paneer Selvam (6): drm/ttm: Add new callbacks to ttm res mgr drm/ttm: Implement intersect/compatible functions drm/amdgpu: Implement intersect/compatible functions drm/i915: Implement intersect/compatible functions drm/nouveau: Implement intersect/compatible functions drm/ttm: Switch to using the new res callback Beniamin Sandu (1): drm/nouveau/hwmon: use simplified HWMON_CHANNEL_INFO macro Bo-Chen Chen (4): drm/mediatek: dp: Add multiple bridge types support drm/mediatek: dp: Add multiple smc commands support drm/mediatek: dp: Add multiple calibration data formats support drm/mediatek: dp: Determine device of next_bridge Chen-Yu Tsai (1): drm/panel-edp: Add Innolux N120ACA-EA1 panel entry Chia-I Wu (1): drm/virtio: set fb_modifiers_not_supported Chris Morgan (2): dt-bindings: Add byteswap order to chrontel ch7033 drm/bridge: chrontel-ch7033: Add byteswap order setting Danilo Krummrich (4): drm/vc4: hdmi: unlock mutex when device is unplugged drm/vc4: plane: protect device resources after removal drm/vc4: crtc: protect device resources after removal drm/vc4: hvs: protect drm_print_regset32() Douglas Anderson (2): MAINTAINERS: Add myself as a reviewer for panel-edp.c drm/panel-edp: Fix typo in kerneldoc comment (appers=>appears) Gerd Hoffmann (1): drm/bochs: fix
[PULL] drm-misc-next
Hi Dave, Daniel, A pull request prepared in Germany and Denmark, but sent from Sweden after fighting with gpg on an infamous bridge. My computer's somewhere in my trunk so I just copied someone else's pull request and pretend my laptop is a dev machine that sends pull requests every day works.. Tag is still correctly signed, hope I didn't mess up anything! drm-misc-next-2022-08-20-1: drm-misc-next for v6.1: UAPI Changes: Cross-subsystem Changes: - DMA-buf: documentation updates. - Assorted small fixes to vga16fb - Fix fbdev drivers to use the aperture helpers. - Make removal of conflicting drivers work correctly without fbdev enabled. Core Changes: - bridge, scheduler, dp-mst: Assorted small fixes. - Add more format helpers to fourcc, and use it to replace the cpp usage. - Add DRM_FORMAT_Cxx, DRM_FORMAT_Rxx (single channel), and DRM_FORMAT_Dxx ("darkness", inverted single channel) - Add packed AYUV and XYUV formats. - Assorted documentation updates. - Rename ttm_bo_init to ttm_bo_init_validate. - Allow TTM bo's to exist without backing store. - Convert drm selftests to kunit. - Add managed init functions for (panel) bridge, crtc, encoder and connector. - Fix endianness handling in various format conversion helpers. - Make tests pass on big-endian platforms, and add test for rgb888 -> rgb565 - Move DRM_PLANE_HELPER_NO_SCALING to atomic helpers and rename, so drm_plane_helper is no longer needed in most drivers. - Use idr_init_base instead of idr_init. - Rename FB and GEM CMA helpers to DMA helpers. - Rework XRGB related conversion helpers, and add drm_fb_blit() that takes a iosys_map. Make drm_fb_memcpy take an iosys_map too. - Move edid luminance calculation to core, and use it in i915. Driver Changes: - bridge/{adv7511,ti-sn65dsi86,parade-ps8640}, panel/{simple,nt35510,tc358767}, nouveau, sun4i, mipi-dsi, mgag200, bochs, arm, komeda, vmwgfx, pl111: Assorted small fixes and doc updates. - vc4: Rework hdmi power up, and depend on PM. - panel/simple: Add Samsung LTL101AL01. - ingenic: Add JZ4760(B) support, avoid a modeset when sharpness property is unchanged, and use the new PM ops. - Revert some amdgpu commits that cause garbaged graphics when starting X, and reapply them with the real problem fixed. - Completely rework vc4 init to use managed helpers. - Rename via_drv to via_dri1, and move all stuff there only used by the dri1 implementation in preperation for atomic modeset. - Use regmap bulk write in ssd130x. - Power sequence and clock updates to it6505. - Split panel-sitrox-st7701 init sequence and rework mode programming code. - virtio: Improve error and edge conditions handling, and convert to use managed helpers. - Add Samsung LTL101AL01, B120XAN01.0, R140NWF5 RH, DMT028VGHMCMI-1A T, panels. - Add generic fbdev support to komeda. - Split mgag200 modeset handling to make it more model-specific. - Convert simpledrm to use atomic helpers. - Improve udl suspend/disconnect handling. The following changes since commit 2bc7ea71a73747a77e7f83bc085b0d2393235410: Merge tag 'topic/nouveau-misc-2022-07-27' of git://anongit.freedesktop.org/drm/drm into drm-next (2022-07-27 11:34:07 +1000) are available in the Git repository at: git://anongit.freedesktop.org/drm/drm-misc tags/drm-misc-next-2022-08-20-1 for you to fetch changes up to 8869fa666a9e6782c3c896c1fa57d65adca23249: drm/virtio: remove drm_plane_cleanup() destroy hook (2022-08-19 16:00:15 +0200) drm-misc-next for v6.1: UAPI Changes: Cross-subsystem Changes: - DMA-buf: documentation updates. - Assorted small fixes to vga16fb - Fix fbdev drivers to use the aperture helpers. - Make removal of conflicting drivers work correctly without fbdev enabled. Core Changes: - bridge, scheduler, dp-mst: Assorted small fixes. - Add more format helpers to fourcc, and use it to replace the cpp usage. - Add DRM_FORMAT_Cxx, DRM_FORMAT_Rxx (single channel), and DRM_FORMAT_Dxx ("darkness", inverted single channel) - Add packed AYUV and XYUV formats. - Assorted documentation updates. - Rename ttm_bo_init to ttm_bo_init_validate. - Allow TTM bo's to exist without backing store. - Convert drm selftests to kunit. - Add managed init functions for (panel) bridge, crtc, encoder and connector. - Fix endianness handling in various format conversion helpers. - Make tests pass on big-endian platforms, and add test for rgb888 -> rgb565 - Move DRM_PLANE_HELPER_NO_SCALING to atomic helpers and rename, so drm_plane_helper is no longer needed in most drivers. - Use idr_init_base instead of idr_init. - Rename FB and GEM CMA helpers to DMA helpers. - Rework XRGB related conversion helpers, and add drm_fb_blit() that takes a iosys_map. Make drm_fb_memcpy take an iosys_map too. - Move edid luminance calculation to core, and use it in i915. Driver Changes: - bridge/{adv7511,ti-sn65dsi86,parade-ps8640}, panel/{simple,nt35510,tc358767}, nouveau, sun4i,
[PATCH 1/2] drm/i915: Remove gem and overlay frontbuffer tracking
Frontbuffer update handling should be done explicitly by using dirtyfb calls only. Signed-off-by: Maarten Lankhorst --- drivers/gpu/drm/i915/display/intel_fb.c | 1 + drivers/gpu/drm/i915/display/intel_overlay.c | 14 --- .../drm/i915/display/intel_plane_initial.c| 1 + drivers/gpu/drm/i915/display/intel_psr.c | 1 + drivers/gpu/drm/i915/gem/i915_gem_clflush.c | 4 --- drivers/gpu/drm/i915/gem/i915_gem_domain.c| 7 -- .../gpu/drm/i915/gem/i915_gem_execbuffer.c| 2 -- drivers/gpu/drm/i915/gem/i915_gem_object.c| 25 --- drivers/gpu/drm/i915/gem/i915_gem_object.h| 22 drivers/gpu/drm/i915/gem/i915_gem_phys.c | 4 --- drivers/gpu/drm/i915/i915_drv.h | 1 - drivers/gpu/drm/i915/i915_gem.c | 6 - drivers/gpu/drm/i915/i915_gem_gtt.c | 1 - drivers/gpu/drm/i915/i915_vma.c | 12 - 14 files changed, 3 insertions(+), 98 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_fb.c b/drivers/gpu/drm/i915/display/intel_fb.c index b191915ab351..88d6189f9c1c 100644 --- a/drivers/gpu/drm/i915/display/intel_fb.c +++ b/drivers/gpu/drm/i915/display/intel_fb.c @@ -12,6 +12,7 @@ #include "intel_display_types.h" #include "intel_dpt.h" #include "intel_fb.h" +#include "intel_frontbuffer.h" #define check_array_bounds(i915, a, i) drm_WARN_ON(&(i915)->drm, (i) >= ARRAY_SIZE(a)) diff --git a/drivers/gpu/drm/i915/display/intel_overlay.c b/drivers/gpu/drm/i915/display/intel_overlay.c index 79ed8bd04a07..23feb6e8d336 100644 --- a/drivers/gpu/drm/i915/display/intel_overlay.c +++ b/drivers/gpu/drm/i915/display/intel_overlay.c @@ -186,7 +186,6 @@ struct intel_overlay { struct intel_crtc *crtc; struct i915_vma *vma; struct i915_vma *old_vma; - struct intel_frontbuffer *frontbuffer; bool active; bool pfit_active; u32 pfit_vscale_ratio; /* shifted-point number, (1<<12) == 1.0 */ @@ -287,20 +286,9 @@ static void intel_overlay_flip_prepare(struct intel_overlay *overlay, struct i915_vma *vma) { enum pipe pipe = overlay->crtc->pipe; - struct intel_frontbuffer *frontbuffer = NULL; drm_WARN_ON(>i915->drm, overlay->old_vma); - if (vma) - frontbuffer = intel_frontbuffer_get(vma->obj); - - intel_frontbuffer_track(overlay->frontbuffer, frontbuffer, - INTEL_FRONTBUFFER_OVERLAY(pipe)); - - if (overlay->frontbuffer) - intel_frontbuffer_put(overlay->frontbuffer); - overlay->frontbuffer = frontbuffer; - intel_frontbuffer_flip_prepare(overlay->i915, INTEL_FRONTBUFFER_OVERLAY(pipe)); @@ -810,8 +798,6 @@ static int intel_overlay_do_put_image(struct intel_overlay *overlay, goto out_pin_section; } - i915_gem_object_flush_frontbuffer(new_bo, ORIGIN_DIRTYFB); - if (!overlay->active) { const struct intel_crtc_state *crtc_state = overlay->crtc->config; diff --git a/drivers/gpu/drm/i915/display/intel_plane_initial.c b/drivers/gpu/drm/i915/display/intel_plane_initial.c index d10f27d0b7b0..8ca6d2fab243 100644 --- a/drivers/gpu/drm/i915/display/intel_plane_initial.c +++ b/drivers/gpu/drm/i915/display/intel_plane_initial.c @@ -9,6 +9,7 @@ #include "intel_display.h" #include "intel_display_types.h" #include "intel_fb.h" +#include "intel_frontbuffer.h" #include "intel_plane_initial.h" static bool diff --git a/drivers/gpu/drm/i915/display/intel_psr.c b/drivers/gpu/drm/i915/display/intel_psr.c index 98c3c8015a5c..a12ef0132697 100644 --- a/drivers/gpu/drm/i915/display/intel_psr.c +++ b/drivers/gpu/drm/i915/display/intel_psr.c @@ -32,6 +32,7 @@ #include "intel_de.h" #include "intel_display_types.h" #include "intel_dp_aux.h" +#include "intel_frontbuffer.h" #include "intel_hdmi.h" #include "intel_psr.h" #include "intel_snps_phy.h" diff --git a/drivers/gpu/drm/i915/gem/i915_gem_clflush.c b/drivers/gpu/drm/i915/gem/i915_gem_clflush.c index 0512afdd20d8..427ff744b02a 100644 --- a/drivers/gpu/drm/i915/gem/i915_gem_clflush.c +++ b/drivers/gpu/drm/i915/gem/i915_gem_clflush.c @@ -6,8 +6,6 @@ #include -#include "display/intel_frontbuffer.h" - #include "i915_drv.h" #include "i915_gem_clflush.h" #include "i915_sw_fence_work.h" @@ -22,8 +20,6 @@ static void __do_clflush(struct drm_i915_gem_object *obj) { GEM_BUG_ON(!i915_gem_object_has_pages(obj)); drm_clflush_sg(obj->mm.pages); - - i915_gem_object_flush_frontbuffer(obj, ORIGIN_CPU); } static void clflush_work(struct dma_fence_wor
[PATCH 0/2] drm/i915: Remove frontbuffer tracking from gem.
Frontbuffer tracking in gem is used in old drivers, but nowadays everyone calls dirtyfb explicitly. Remove frontbuffer tracking from gem, and isolate it to display only. Maarten Lankhorst (2): drm/i915: Remove gem and overlay frontbuffer tracking drm/i915: Remove special frontbuffer type drivers/gpu/drm/i915/display/intel_cursor.c | 6 +- drivers/gpu/drm/i915/display/intel_display.c | 4 +- .../drm/i915/display/intel_display_types.h| 8 +- drivers/gpu/drm/i915/display/intel_fb.c | 11 +- drivers/gpu/drm/i915/display/intel_fbdev.c| 7 +- .../gpu/drm/i915/display/intel_frontbuffer.c | 103 ++ .../gpu/drm/i915/display/intel_frontbuffer.h | 65 ++- drivers/gpu/drm/i915/display/intel_overlay.c | 14 --- .../drm/i915/display/intel_plane_initial.c| 3 +- drivers/gpu/drm/i915/display/intel_psr.c | 1 + drivers/gpu/drm/i915/gem/i915_gem_clflush.c | 4 - drivers/gpu/drm/i915/gem/i915_gem_domain.c| 7 -- .../gpu/drm/i915/gem/i915_gem_execbuffer.c| 2 - drivers/gpu/drm/i915/gem/i915_gem_object.c| 25 - drivers/gpu/drm/i915/gem/i915_gem_object.h| 22 drivers/gpu/drm/i915/gem/i915_gem_phys.c | 4 - drivers/gpu/drm/i915/i915_driver.c| 1 + drivers/gpu/drm/i915/i915_drv.h | 1 - drivers/gpu/drm/i915/i915_gem.c | 8 -- drivers/gpu/drm/i915/i915_gem_gtt.c | 1 - drivers/gpu/drm/i915/i915_vma.c | 12 -- 21 files changed, 35 insertions(+), 274 deletions(-) -- 2.34.1
[PATCH 2/2] drm/i915: Remove special frontbuffer type
Signed-off-by: Maarten Lankhorst --- drivers/gpu/drm/i915/display/intel_cursor.c | 6 +- drivers/gpu/drm/i915/display/intel_display.c | 4 +- .../drm/i915/display/intel_display_types.h| 8 +- drivers/gpu/drm/i915/display/intel_fb.c | 10 +- drivers/gpu/drm/i915/display/intel_fbdev.c| 7 +- .../gpu/drm/i915/display/intel_frontbuffer.c | 103 ++ .../gpu/drm/i915/display/intel_frontbuffer.h | 65 ++- .../drm/i915/display/intel_plane_initial.c| 2 +- drivers/gpu/drm/i915/i915_driver.c| 1 + drivers/gpu/drm/i915/i915_gem.c | 2 - 10 files changed, 32 insertions(+), 176 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_cursor.c b/drivers/gpu/drm/i915/display/intel_cursor.c index 16ac560eab49..eaf46487e720 100644 --- a/drivers/gpu/drm/i915/display/intel_cursor.c +++ b/drivers/gpu/drm/i915/display/intel_cursor.c @@ -689,10 +689,10 @@ intel_legacy_cursor_update(struct drm_plane *_plane, if (ret) goto out_free; - intel_frontbuffer_flush(to_intel_frontbuffer(new_plane_state->hw.fb), + intel_frontbuffer_flush(to_intel_framebuffer(new_plane_state->hw.fb), ORIGIN_CURSOR_UPDATE); - intel_frontbuffer_track(to_intel_frontbuffer(old_plane_state->hw.fb), - to_intel_frontbuffer(new_plane_state->hw.fb), + intel_frontbuffer_track(to_intel_framebuffer(old_plane_state->hw.fb), + to_intel_framebuffer(new_plane_state->hw.fb), plane->frontbuffer_bit); /* Swap plane state */ diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c index 533fff79aeda..ae71ac40de41 100644 --- a/drivers/gpu/drm/i915/display/intel_display.c +++ b/drivers/gpu/drm/i915/display/intel_display.c @@ -7727,8 +7727,8 @@ static void intel_atomic_track_fbs(struct intel_atomic_state *state) for_each_oldnew_intel_plane_in_state(state, plane, old_plane_state, new_plane_state, i) - intel_frontbuffer_track(to_intel_frontbuffer(old_plane_state->hw.fb), - to_intel_frontbuffer(new_plane_state->hw.fb), + intel_frontbuffer_track(to_intel_framebuffer(old_plane_state->hw.fb), + to_intel_framebuffer(new_plane_state->hw.fb), plane->frontbuffer_bit); } diff --git a/drivers/gpu/drm/i915/display/intel_display_types.h b/drivers/gpu/drm/i915/display/intel_display_types.h index 0da9b208d56e..f0963de13abf 100644 --- a/drivers/gpu/drm/i915/display/intel_display_types.h +++ b/drivers/gpu/drm/i915/display/intel_display_types.h @@ -132,6 +132,8 @@ struct intel_fb_view { struct intel_framebuffer { struct drm_framebuffer base; + + atomic_t bits; struct intel_frontbuffer *frontbuffer; /* Params to remap the FB pages and program the plane registers in each view. */ @@ -2061,10 +2063,4 @@ static inline u32 intel_plane_ggtt_offset(const struct intel_plane_state *plane_ return i915_ggtt_offset(plane_state->ggtt_vma); } -static inline struct intel_frontbuffer * -to_intel_frontbuffer(struct drm_framebuffer *fb) -{ - return fb ? to_intel_framebuffer(fb)->frontbuffer : NULL; -} - #endif /* __INTEL_DISPLAY_TYPES_H__ */ diff --git a/drivers/gpu/drm/i915/display/intel_fb.c b/drivers/gpu/drm/i915/display/intel_fb.c index 88d6189f9c1c..9c1a093ed9b1 100644 --- a/drivers/gpu/drm/i915/display/intel_fb.c +++ b/drivers/gpu/drm/i915/display/intel_fb.c @@ -1820,8 +1820,6 @@ static void intel_user_framebuffer_destroy(struct drm_framebuffer *fb) if (intel_fb_uses_dpt(fb)) intel_dpt_destroy(intel_fb->dpt_vm); - intel_frontbuffer_put(intel_fb->frontbuffer); - kfree(intel_fb); } @@ -1850,7 +1848,7 @@ static int intel_user_framebuffer_dirty(struct drm_framebuffer *fb, struct drm_i915_gem_object *obj = intel_fb_obj(fb); i915_gem_object_flush_if_display(obj); - intel_frontbuffer_flush(to_intel_frontbuffer(fb), ORIGIN_DIRTYFB); + intel_frontbuffer_flush(to_intel_framebuffer(fb), ORIGIN_DIRTYFB); return 0; } @@ -1872,10 +1870,7 @@ int intel_framebuffer_init(struct intel_framebuffer *intel_fb, int ret = -EINVAL; int i; - intel_fb->frontbuffer = intel_frontbuffer_get(obj); - if (!intel_fb->frontbuffer) - return -ENOMEM; - + atomic_set(_fb->bits, 0); i915_gem_object_lock(obj, NULL); tiling = i915_gem_object_get_tiling(obj); stride = i915_gem_object_get_stride(obj); @@ -2011,7 +2006,6 @@ int intel_framebuffer_init(struct intel_framebuffer *intel_fb, return 0; err: - intel_frontbuffer_put(intel_fb->
Re: [PATCH] drm/i915: Use i915_gem_object_ggtt_pin_ww for reloc_iomap
Op 11-05-2022 om 20:23 schreef Matthew Auld: > On 11/05/2022 12:52, Maarten Lankhorst wrote: >> Instead of its own path, use the common path when it doesn't result >> in evicting any vma. This fixes the case where we don't wait for >> binding. >> > > https://gitlab.freedesktop.org/drm/intel/-/issues/5806 > > If I'm reading that correctly waiting for the bind doesn't seem to help? I suspect the actual pinning there might do some stuff that we are not doing. It was working before the change, and manually calling pin caused the failure, so I reverted it back to what was working before. It was specifically the manual pin code that was failing. I can change the commit message if it helps. ~Maarten >> Fixes: b5cfe6f7a6e1 ("drm/i915: Remove short-term pins from execbuf, v6.") >> Cc: Matthew Auld >> Reported-by: Mateusz Jończyk >> Tested-by: Hans de Goede >> Signed-off-by: Maarten Lankhorst >> --- >> drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c | 6 ++ >> 1 file changed, 2 insertions(+), 4 deletions(-) >> >> diff --git a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c >> b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c >> index 498b458fd784..919d01082909 100644 >> --- a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c >> +++ b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c >> @@ -1262,14 +1262,12 @@ static void *reloc_iomap(struct i915_vma *batch, >> * Only attempt to pin the batch buffer to ggtt if the current >> batch >> * is not inside ggtt, or the batch buffer is not misplaced. >> */ >> - if (!i915_is_ggtt(batch->vm)) { >> + if (!i915_is_ggtt(batch->vm) || >> + !i915_vma_misplaced(batch, 0, 0, PIN_MAPPABLE)) { >> vma = i915_gem_object_ggtt_pin_ww(obj, >ww, NULL, 0, 0, >> PIN_MAPPABLE | >> PIN_NONBLOCK /* NOWARN */ | >> PIN_NOEVICT); >> - } else if (i915_vma_is_map_and_fenceable(batch)) { >> - __i915_vma_pin(batch); >> - vma = batch; >> } >> if (vma == ERR_PTR(-EDEADLK))
[PATCH] drm/i915: Use i915_gem_object_ggtt_pin_ww for reloc_iomap
Instead of its own path, use the common path when it doesn't result in evicting any vma. This fixes the case where we don't wait for binding. Fixes: b5cfe6f7a6e1 ("drm/i915: Remove short-term pins from execbuf, v6.") Cc: Matthew Auld Reported-by: Mateusz Jończyk Tested-by: Hans de Goede Signed-off-by: Maarten Lankhorst --- drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c index 498b458fd784..919d01082909 100644 --- a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c +++ b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c @@ -1262,14 +1262,12 @@ static void *reloc_iomap(struct i915_vma *batch, * Only attempt to pin the batch buffer to ggtt if the current batch * is not inside ggtt, or the batch buffer is not misplaced. */ - if (!i915_is_ggtt(batch->vm)) { + if (!i915_is_ggtt(batch->vm) || + !i915_vma_misplaced(batch, 0, 0, PIN_MAPPABLE)) { vma = i915_gem_object_ggtt_pin_ww(obj, >ww, NULL, 0, 0, PIN_MAPPABLE | PIN_NONBLOCK /* NOWARN */ | PIN_NOEVICT); - } else if (i915_vma_is_map_and_fenceable(batch)) { - __i915_vma_pin(batch); - vma = batch; } if (vma == ERR_PTR(-EDEADLK)) -- 2.36.1
[PULL] drm-misc-fixes
drm-misc-fixes-2022-05-05: drm-misc-fixes for v5.18-rc6: - Small fix for hot-unplugging fb devices. - Kconfig fix for it6505. The following changes since commit dc3ae06c5f2170d879ff58696f629d8c3868aec3: drm/sun4i: Remove obsolete references to PHYS_OFFSET (2022-04-26 14:39:56 +0200) are available in the Git repository at: git://anongit.freedesktop.org/drm/drm-misc tags/drm-misc-fixes-2022-05-05 for you to fetch changes up to 841e512ffb64898db6322c0619f6bbc41266d86f: drm/bridge: ite-it6505: add missing Kconfig option select (2022-05-04 10:14:16 +0200) drm-misc-fixes for v5.18-rc6: - Small fix for hot-unplugging fb devices. - Kconfig fix for it6505. Fabien Parent (1): drm/bridge: ite-it6505: add missing Kconfig option select Javier Martinez Canillas (1): fbdev: Make fb_release() return -ENODEV if fbdev was unregistered drivers/gpu/drm/bridge/Kconfig | 1 + drivers/video/fbdev/core/fbmem.c | 5 - 2 files changed, 5 insertions(+), 1 deletion(-)
[PULL] drm-misc-fixes
drm-misc-fixes-2022-04-27: drm-misc-fixes for v5.18-rc5: - Single fix removing applying PHYS_OFFSET twice in sunxi. The following changes since commit 94f4c4965e5513ba624488f4b601d6b385635aec: drm/amdgpu: partial revert "remove ctx->lock" v2 (2022-04-21 11:26:20 +0200) are available in the Git repository at: git://anongit.freedesktop.org/drm/drm-misc tags/drm-misc-fixes-2022-04-27 for you to fetch changes up to dc3ae06c5f2170d879ff58696f629d8c3868aec3: drm/sun4i: Remove obsolete references to PHYS_OFFSET (2022-04-26 14:39:56 +0200) drm-misc-fixes for v5.18-rc5: - Single fix removing applying PHYS_OFFSET twice in sunxi. Samuel Holland (1): drm/sun4i: Remove obsolete references to PHYS_OFFSET drivers/gpu/drm/sun4i/sun4i_frontend.c | 3 --- 1 file changed, 3 deletions(-)
[PULL] drm-misc-next-fixes
drm-misc-next-fixes-2022-04-07: drm-misc-next-fixes for v5.18-rc2: - fix warning about fence containers - fix logic error in new fence merge code - handle empty dma_fence_arrays gracefully - Try all possible cases for bridge/panel detection. The following changes since commit 7344bad7fb6daa4877a1c064b52c7d5f9182c41b: drm/edid: fix CEA extension byte #3 parsing (2022-03-24 11:41:14 +0200) are available in the Git repository at: git://anongit.freedesktop.org/drm/drm-misc tags/drm-misc-next-fixes-2022-04-07 for you to fetch changes up to 67bae5f28c895f8737a1974c3f31cf12b9170b14: drm: of: Properly try all possible cases for bridge/panel detection (2022-03-30 10:16:05 +0200) drm-misc-next-fixes for v5.18-rc2: - fix warning about fence containers - fix logic error in new fence merge code - handle empty dma_fence_arrays gracefully - Try all possible cases for bridge/panel detection. Christian König (5): dma-buf: Add dma_fence_array_for_each (v2) dma-buf: add dma_fence_unwrap v2 dma-buf/sync-file: fix warning about fence containers dma-buf/sync-file: fix logic error in new fence merge code dma-buf: handle empty dma_fence_arrays gracefully Paul Kocialkowski (1): drm: of: Properly try all possible cases for bridge/panel detection Documentation/driver-api/dma-buf.rst | 6 + drivers/dma-buf/Makefile | 1 + drivers/dma-buf/dma-fence-array.c | 32 + drivers/dma-buf/selftests.h | 1 + drivers/dma-buf/st-dma-fence-unwrap.c | 261 ++ drivers/dma-buf/sync_file.c | 141 +- drivers/gpu/drm/drm_of.c | 99 ++--- include/linux/dma-fence-array.h | 19 +++ include/linux/dma-fence-chain.h | 2 + include/linux/dma-fence-unwrap.h | 95 + 10 files changed, 540 insertions(+), 117 deletions(-) create mode 100644 drivers/dma-buf/st-dma-fence-unwrap.c create mode 100644 include/linux/dma-fence-unwrap.h
[PULL] drm-misc-fixes
drm-misc-fixes-2022-04-07: drm-misc-fixes for v5.18-rc2: - Fix a crash when booting with nouveau on tegra. - Don't require input port for MIPI-DSI, and make width/height mandatory. - Fix unregistering of framebuffers without device. - The following changes since commit 3123109284176b1532874591f7c81f3837bbdc17: Linux 5.18-rc1 (2022-04-03 14:08:21 -0700) are available in the Git repository at: git://anongit.freedesktop.org/drm/drm-misc tags/drm-misc-fixes-2022-04-07 for you to fetch changes up to 1ecc0c09f19f8e10a2c52676f8ca47c28c9f73c7: dt-bindings: display: panel: mipi-dbi-spi: Make width-mm/height-mm mandatory (2022-04-07 03:28:10 +0200) drm-misc-fixes for v5.18-rc2: - Fix a crash when booting with nouveau on tegra. - Don't require input port for MIPI-DSI, and make width/height mandatory. - Fix unregistering of framebuffers without device. - Christian König (5): dma-buf: Add dma_fence_array_for_each (v2) dma-buf: add dma_fence_unwrap v2 dma-buf/sync-file: fix warning about fence containers dma-buf/sync-file: fix logic error in new fence merge code dma-buf: handle empty dma_fence_arrays gracefully Karol Herbst (1): drm/nouveau/pmu: Add missing callbacks for Tegra devices Marek Vasut (1): dt-bindings: display: panel: mipi-dbi-spi: Make width-mm/height-mm mandatory Maxime Ripard (3): dt-bindings: display: bridge: Drop requirement on input port for DSI devices Merge drm/drm-fixes into drm-misc-fixes Merge drm-misc/drm-misc-next-fixes into drm-misc-fixes Paul Kocialkowski (1): drm: of: Properly try all possible cases for bridge/panel detection Thomas Zimmermann (1): fbdev: Fix unregistering of framebuffers without device .../bindings/display/bridge/chipone,icn6211.yaml | 1 - .../bindings/display/bridge/toshiba,tc358762.yaml | 1 - .../bindings/display/panel/panel-mipi-dbi-spi.yaml | 2 + Documentation/driver-api/dma-buf.rst | 6 + drivers/dma-buf/Makefile | 1 + drivers/dma-buf/dma-fence-array.c | 32 +++ drivers/dma-buf/selftests.h| 1 + drivers/dma-buf/st-dma-fence-unwrap.c | 261 + drivers/dma-buf/sync_file.c| 141 +-- drivers/gpu/drm/drm_of.c | 99 drivers/gpu/drm/nouveau/nvkm/subdev/pmu/gm20b.c| 1 + drivers/gpu/drm/nouveau/nvkm/subdev/pmu/gp102.c| 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/pmu/gp10b.c| 1 + drivers/gpu/drm/nouveau/nvkm/subdev/pmu/priv.h | 1 + drivers/gpu/drm/panel/panel-ilitek-ili9341.c | 4 +- drivers/video/fbdev/core/fbmem.c | 9 +- include/linux/dma-fence-array.h| 19 ++ include/linux/dma-fence-chain.h| 2 + include/linux/dma-fence-unwrap.h | 95 19 files changed, 557 insertions(+), 122 deletions(-) create mode 100644 drivers/dma-buf/st-dma-fence-unwrap.c create mode 100644 include/linux/dma-fence-unwrap.h
[PULL] drm-misc-next-fixes
The previous pull request tag was botched due to my key expiring, updated! drm-misc-next-fixes-2022-03-24-1: drm-misc-next-fixes for v5.18-rc1: - Make audio and color plane support checking only happen when a CEA extension block is found. - Fix a small regression from ttm_resource_fini() - Small selftest fix. The following changes since commit f6d790e5a7fe42706756c7fa1686d08d230610fc: Merge tag 'drm-intel-next-fixes-2022-03-10' of git://anongit.freedesktop.org/drm/drm-intel into drm-next (2022-03-11 13:27:00 +1000) are available in the Git repository at: git://anongit.freedesktop.org/drm/drm-misc tags/drm-misc-next-fixes-2022-03-24-1 for you to fetch changes up to 7344bad7fb6daa4877a1c064b52c7d5f9182c41b: drm/edid: fix CEA extension byte #3 parsing (2022-03-24 11:41:14 +0200) drm-misc-next-fixes for v5.18-rc1: - Make audio and color plane support checking only happen when a CEA extension block is found. - Fix a small regression from ttm_resource_fini() - Small selftest fix. Cooper Chiou (1): drm/edid: check basic audio support on CEA extension block Jani Nikula (1): drm/edid: fix CEA extension byte #3 parsing Nathan Chancellor (1): drm/selftest: plane_helper: Put test structures in static storage Zack Rusin (1): drm/ttm: Fix a kernel oops due to an invalid read drivers/gpu/drm/drm_edid.c| 15 ++- drivers/gpu/drm/selftests/test-drm_plane_helper.c | 8 drivers/gpu/drm/ttm/ttm_range_manager.c | 2 +- 3 files changed, 15 insertions(+), 10 deletions(-)
[PULL] drm-misc-next-fixes
drm-misc-next-fixes-2022-03-24: Short summary of fixes pull (less than what git shortlog provides): - explain anything non-fixes (e.g. cleanups) and why it's appropriate - highlight regressions - summarize pull requests contained This shouldn't be more than a few lines (or it indicates your fixes pull is a bit too big). The following changes since commit f6d790e5a7fe42706756c7fa1686d08d230610fc: Merge tag 'drm-intel-next-fixes-2022-03-10' of git://anongit.freedesktop.org/drm/drm-intel into drm-next (2022-03-11 13:27:00 +1000) are available in the Git repository at: git://anongit.freedesktop.org/drm/drm-misc tags/drm-misc-next-fixes-2022-03-24 for you to fetch changes up to 7344bad7fb6daa4877a1c064b52c7d5f9182c41b: drm/edid: fix CEA extension byte #3 parsing (2022-03-24 11:41:14 +0200) Short summary of fixes pull (less than what git shortlog provides): - explain anything non-fixes (e.g. cleanups) and why it's appropriate - highlight regressions - summarize pull requests contained This shouldn't be more than a few lines (or it indicates your fixes pull is a bit too big). Cooper Chiou (1): drm/edid: check basic audio support on CEA extension block Jani Nikula (1): drm/edid: fix CEA extension byte #3 parsing Nathan Chancellor (1): drm/selftest: plane_helper: Put test structures in static storage Zack Rusin (1): drm/ttm: Fix a kernel oops due to an invalid read drivers/gpu/drm/drm_edid.c| 15 ++- drivers/gpu/drm/selftests/test-drm_plane_helper.c | 8 drivers/gpu/drm/ttm/ttm_range_manager.c | 2 +- 3 files changed, 15 insertions(+), 10 deletions(-)