aboutsummaryrefslogtreecommitdiff
path: root/drivers
AgeCommit message (Collapse)AuthorFilesLines
2023-07-12drm/amdgpu: use drm_exec for GEM and CSA handling v2Christian König2-87/+72
Start using the new component here as well. v2: ignore duplicates to allow per VM BO mappings Signed-off-by: Christian König <[email protected]> Acked-by: Alex Deucher <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2023-07-12drm/amdkfd: switch over to using drm_exec v3Christian König6-212/+164
Avoids quite a bit of logic and kmalloc overhead. v2: fix multiple problems pointed out by Felix v3: two more nit picks from Felix fixed Signed-off-by: Christian König <[email protected]> Reviewed-by: Felix Kuehling <[email protected]> Acked-by: Alex Deucher <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2023-07-12drm: add drm_exec selftests v4Christian König3-1/+162
Exercise at least all driver facing functions of this new component. v2: add array test as well v3: some kunit cleanups v4: more tests and cleanups Signed-off-by: Christian König <[email protected]> Acked-by: Alex Deucher <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2023-07-12drm: execution context for GEM buffers v7Christian König3-0/+341
This adds the infrastructure for an execution context for GEM buffers which is similar to the existing TTMs execbuf util and intended to replace it in the long term. The basic functionality is that we abstracts the necessary loop to lock many different GEM buffers with automated deadlock and duplicate handling. v2: drop xarray and use dynamic resized array instead, the locking overhead is unnecessary and measurable. v3: drop duplicate tracking, radeon is really the only one needing that. v4: fixes issues pointed out by Danilo, some typos in comments and a helper for lock arrays of GEM objects. v5: some suggestions by Boris Brezillon, especially just use one retry macro, drop loop in prepare_array, use flags instead of bool v6: minor changes suggested by Thomas, Boris and Danilo v7: minor typos pointed out by checkpatch.pl fixed Signed-off-by: Christian König <[email protected]> Reviewed-by: Boris Brezillon <[email protected]> Reviewed-by: Danilo Krummrich <[email protected]> Tested-by: Danilo Krummrich <[email protected]> Acked-by: Alex Deucher <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2023-07-11fbdev/hyperv_fb: Include <linux/screen_info.h>Thomas Zimmermann1-0/+1
Include <linux/screen_info.h> to get the global screen_info state. Fixes the following errors: >> drivers/video/fbdev/hyperv_fb.c:1033:10: error: use of undeclared identifier 'screen_info' 1033 | base = screen_info.lfb_base; | ^ drivers/video/fbdev/hyperv_fb.c:1034:10: error: use of undeclared identifier 'screen_info' 1034 | size = screen_info.lfb_size; | ^ >> drivers/video/fbdev/hyperv_fb.c:1080:3: error: must use 'struct' tag to refer to type 'screen_info' 1080 | screen_info.lfb_size = 0; | ^ | struct >> drivers/video/fbdev/hyperv_fb.c:1080:14: error: expected identifier or '(' 1080 | screen_info.lfb_size = 0; | ^ drivers/video/fbdev/hyperv_fb.c:1081:3: error: must use 'struct' tag to refer to type 'screen_info' 1081 | screen_info.lfb_base = 0; | ^ | struct drivers/video/fbdev/hyperv_fb.c:1081:14: error: expected identifier or '(' 1081 | screen_info.lfb_base = 0; | ^ drivers/video/fbdev/hyperv_fb.c:1082:3: error: must use 'struct' tag to refer to type 'screen_info' 1082 | screen_info.orig_video_isVGA = 0; | ^ | struct drivers/video/fbdev/hyperv_fb.c:1082:14: error: expected identifier or '(' 1082 | screen_info.orig_video_isVGA = 0; | ^ 8 errors generated. Reported-by: kernel test robot <[email protected]> Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/ Fixes: 8b0d13545b09 ("efi: Do not include <linux/screen_info.h> from EFI header") Signed-off-by: Thomas Zimmermann <[email protected]> Cc: "K. Y. Srinivasan" <[email protected]> (supporter:Hyper-V/Azure CORE AND DRIVERS) Cc: Haiyang Zhang <[email protected]> (supporter:Hyper-V/Azure CORE AND DRIVERS) Cc: Wei Liu <[email protected]> (supporter:Hyper-V/Azure CORE AND DRIVERS) Cc: Dexuan Cui <[email protected]> (supporter:Hyper-V/Azure CORE AND DRIVERS) Cc: Helge Deller <[email protected]> (maintainer:FRAMEBUFFER LAYER) Cc: Javier Martinez Canillas <[email protected]> Cc: Sui Jingfeng <[email protected]> Cc: Ard Biesheuvel <[email protected]> Cc: Russell King <[email protected]> Cc: Catalin Marinas <[email protected]> Cc: Will Deacon <[email protected]> Cc: Arnd Bergmann <[email protected]> Cc: [email protected] Cc: [email protected] (open list:Hyper-V/Azure CORE AND DRIVERS) Cc: [email protected] (open list:FRAMEBUFFER LAYER) Cc: [email protected] (open list:FRAMEBUFFER LAYER) Reviewed-by: Javier Martinez Canillas <[email protected]> Reviewed-by: Sui Jingfeng <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2023-07-10drm/arm: Make ARM devices menu depend on DRMJavier Martinez Canillas1-0/+1
Otherwise if CONFIG_DRM is disabled, menuconfig will show an empty menu. Signed-off-by: Javier Martinez Canillas <[email protected]> Acked-by: Liviu Dudau <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2023-07-10drm/ttm: Use init_on_free to delay release TTM BOsRajneesh Bhardwaj1-0/+1
Delay release TTM BOs when the kernel default setting is init_on_free. This offloads the overhead of clearing the system memory to the work item and potentially a different CPU. This could be very beneficial when the application does a lot of malloc/free style allocations of system memory. Signed-off-by: Rajneesh Bhardwaj <[email protected]> Reviewed-by: Christian König <[email protected]>. Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Christian König <[email protected]>
2023-07-10drm/bridge: cdns-mhdp8546: Fix the interrupt enable/disableNikhil Devshatwar1-22/+22
When removing the tidss driver, there is a warning reported by kernel about an unhandled interrupt for mhdp driver. [ 43.238895] irq 31: nobody cared (try booting with the "irqpoll" option) ... [snipped backtrace] [ 43.330735] handlers: [ 43.333020] [<000000005367c4f9>] irq_default_primary_handler threaded [<000000007e02b601>] cdns_mhdp_irq_handler [cdns_mhdp8546] [ 43.344607] Disabling IRQ #31 This happens because as part of cdns_mhdp_bridge_hpd_disable, driver tries to disable the interrupts. While disabling the SW_EVENT interrupts, it accidentally enables the MBOX interrupts, which are not handled by the driver. Fix this with a read-modify-write to update only required bits. Use the enable / disable function as required in other places. Signed-off-by: Nikhil Devshatwar <[email protected]> Reviewed-by: Swapnil Jakhade <[email protected]> Reviewed-by: Tomi Valkeinen <[email protected]> Signed-off-by: Aradhya Bhatia <[email protected]> Signed-off-by: Javier Martinez Canillas <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2023-07-10drm/tidss: Update encoder/bridge chain connect modelAradhya Bhatia3-63/+94
With the new encoder/bridge chain model, the display controller driver is required to create a drm_connector entity instead of asking the bridge to do so during drm_bridge_attach. Moreover, the controller driver should create a drm_bridge entity to negotiate bus formats and a 'simple' drm_encoder entity to expose it to userspace. Update the encoder/bridge initialization sequence in tidss as per the new model. Signed-off-by: Aradhya Bhatia <[email protected]> Reviewed-by: Tomi Valkeinen <[email protected]> Signed-off-by: Javier Martinez Canillas <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2023-07-10drm/bridge: sii902x: Set input_bus_flags in atomic_checkAradhya Bhatia1-0/+15
input_bus_flags are specified in drm_bridge_timings (legacy) as well as drm_bridge_state->input_bus_cfg.flags The flags from the timings will be deprecated. Bridges are supposed to validate and set the bridge state flags from atomic_check. Implement atomic_check hook for the same. Signed-off-by: Aradhya Bhatia <[email protected]> Reviewed-by: Neil Armstrong <[email protected]> Reviewed-by: Tomi Valkeinen <[email protected]> Signed-off-by: Javier Martinez Canillas <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2023-07-10drm/bridge: sii902x: Support format negotiation hooksAradhya Bhatia1-0/+25
With new connector model, sii902x will not create the connector, when DRM_BRIDGE_ATTACH_NO_CONNECTOR is set and SoC driver will rely on format negotiation to setup the encoder format. Support format negotiations hooks in the drm_bridge_funcs. Use helper functions for state management. Input format is selected to MEDIA_BUS_FMT_RGB888_1X24 as default, as is the case with older model. Signed-off-by: Aradhya Bhatia <[email protected]> Reviewed-by: Neil Armstrong <[email protected]> Reviewed-by: Tomi Valkeinen <[email protected]> Signed-off-by: Javier Martinez Canillas <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2023-07-10drm/bridge: mhdp8546: Set input_bus_flags from atomic_checkNikhil Devshatwar4-10/+14
input_bus_flags are specified in drm_bridge_timings (legacy) as well as drm_bridge_state->input_bus_cfg.flags The flags from the timings will be deprecated. Bridges are supposed to validate and set the bridge state flags from atomic_check. Signed-off-by: Nikhil Devshatwar <[email protected]> [a-bhatia1: replace timings in cdns_mhdp_platform_info by input_bus_flags] Signed-off-by: Aradhya Bhatia <[email protected]> Reviewed-by: Neil Armstrong <[email protected]> Reviewed-by: Tomi Valkeinen <[email protected]> Signed-off-by: Javier Martinez Canillas <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2023-07-10drm/bridge: mhdp8546: Add minimal format negotiationNikhil Devshatwar1-0/+22
With new connector model, mhdp bridge will not create the connector and SoC driver will rely on format negotiation to setup the encoder format. Support minimal format negotiations hooks in the drm_bridge_funcs. Complete format negotiation can be added based on EDID data. This patch adds the minimal required support to avoid failure after moving to new connector model. Signed-off-by: Nikhil Devshatwar <[email protected]> [a-bhatia1: Drop the output_fmt check condition] Signed-off-by: Aradhya Bhatia <[email protected]> Reviewed-by: Neil Armstrong <[email protected]> Reviewed-by: Tomi Valkeinen <[email protected]> Signed-off-by: Javier Martinez Canillas <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2023-07-10drm/bridge: tfp410: Set input_bus_flags in atomic_checkNikhil Devshatwar1-0/+17
input_bus_flags are specified in drm_bridge_timings (legacy) as well as drm_bridge_state->input_bus_cfg.flags The flags from the timings will be deprecated. Bridges are supposed to validate and set the bridge state flags from atomic_check. Implement atomic_check hook for the same. Signed-off-by: Nikhil Devshatwar <[email protected]> Signed-off-by: Aradhya Bhatia <[email protected]> Reviewed-by: Neil Armstrong <[email protected]> Reviewed-by: Tomi Valkeinen <[email protected]> Signed-off-by: Javier Martinez Canillas <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2023-07-10drm/bridge: tfp410: Support format negotiation hooksNikhil Devshatwar1-0/+26
With new connector model, tfp410 will not create the connector and SoC driver will rely on format negotiation to setup the encoder format. Support format negotiations hooks in the drm_bridge_funcs. Use helper functions for state management. Input format is the one selected by the bridge from DT properties. Signed-off-by: Nikhil Devshatwar <[email protected]> [a-bhatia1: Removed output fmt condition check] Signed-off-by: Aradhya Bhatia <[email protected]> Reviewed-by: Neil Armstrong <[email protected]> Reviewed-by: Tomi Valkeinen <[email protected]> Signed-off-by: Javier Martinez Canillas <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2023-07-10drm/bridge: tc358767: Use devm_clk_get_enabled() helperChristophe JAILLET1-21/+4
The devm_clk_get_enabled() helper: - calls devm_clk_get() - calls clk_prepare_enable() and registers what is needed in order to call clk_disable_unprepare() when needed, as a managed resource. This simplifies the code and avoids the need of a dedicated function used with devm_add_action_or_reset(). Signed-off-by: Christophe JAILLET <[email protected]> Reviewed-by: Andrzej Hajda <[email protected]> Signed-off-by: Robert Foss <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/208a15ce4e01973daf039ad7bc0f9241f650b3af.1672415956.git.christophe.jaillet@wanadoo.fr
2023-07-10drm/nouveau/disp: use drm_kms_helper_connector_hotplug_event()Simon Ser1-3/+14
This adds more information to the hotplug uevent and lets user-space know that it's about a particular connector only. Signed-off-by: Simon Ser <[email protected]> Cc: Ben Skeggs <[email protected]> Cc: Lyude Paul <[email protected]> Cc: David Airlie <[email protected]> Cc: Karol Herbst <[email protected]> Reviewed-by: Lyude Paul <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2023-07-10nouveau/dispnv50: add cursor pitch checkSimon Ser1-2/+23
The hardware needs a FB which is packed. Add checks to make sure this is the case. While at it, add debug logs for the existing checks. This allows user-space to more easily figure out why a configuration is rejected. v2: - Use drm_format_info instead of hardcoding bytes-per-pixel (Ilia) - Remove unnecessary size check (Ilia) v3: - Add missing newlines in debug messages (Lyude) - Use NV_ATOMIC (Lyude) - Add missing debug log for invalid format (Ilia) v4: add plane name in debug messages (Ilia) Signed-off-by: Simon Ser <[email protected]> Reviewed-by: Lyude Paul <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]> Cc: Ben Skeggs <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2023-07-09drm/virtio: Conditionally allocate virtio_gpu_fenceGurchetan Singh1-12/+20
We don't want to create a fence for every command submission. It's only necessary when userspace provides a waitable token for submission. This could be: 1) bo_handles, to be used with VIRTGPU_WAIT 2) out_fence_fd, to be used with dma_fence apis 3) a ring_idx provided with VIRTGPU_CONTEXT_PARAM_POLL_RINGS_MASK + DRM event API 4) syncobjs in the future The use case for just submitting a command to the host, and expecting no response. For example, gfxstream has GFXSTREAM_CONTEXT_PING that just wakes up the host side worker threads. There's also CROSS_DOMAIN_CMD_SEND which just sends data to the Wayland server. This prevents the need to signal the automatically created virtio_gpu_fence. In addition, VIRTGPU_EXECBUF_RING_IDX is checked when creating a DRM event object. VIRTGPU_CONTEXT_PARAM_POLL_RINGS_MASK is already defined in terms of per-context rings. It was theoretically possible to create a DRM event on the global timeline (ring_idx == 0), if the context enabled DRM event polling. However, that wouldn't work and userspace (Sommelier). Explicitly disallow it for clarity. Signed-off-by: Gurchetan Singh <[email protected]> Reviewed-by: Dmitry Osipenko <[email protected]> Tested-by: Dmitry Osipenko <[email protected]> Signed-off-by: Dmitry Osipenko <[email protected]> # edited coding style Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2023-07-09drm/hyperv: Fix a compilation issue because of not including screen_info.hSui Jingfeng1-0/+1
Fixes the following build errors on arm64: drivers/video/fbdev/hyperv_fb.c: In function 'hvfb_getmem': >> drivers/video/fbdev/hyperv_fb.c:1033:24: error: 'screen_info' undeclared (first use in this function) 1033 | base = screen_info.lfb_base; | ^~~~~~~~~~~ drivers/video/fbdev/hyperv_fb.c:1033:24: note: each undeclared identifier is reported only once for each function it appears in >> drivers/gpu/drm/hyperv/hyperv_drm_drv.c:75:54: error: 'screen_info' undeclared (first use in this function) 75 | drm_aperture_remove_conflicting_framebuffers(screen_info.lfb_base, | ^~~~~~~~~~~ drivers/gpu/drm/hyperv/hyperv_drm_drv.c:75:54: note: each undeclared identifier is reported only once for each function it appears in Reported-by: kernel test robot <[email protected]> Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/ Fixes: 81d2393485f0 ("fbdev/hyperv-fb: Do not set struct fb_info.apertures") Fixes: 8b0d13545b09 ("efi: Do not include <linux/screen_info.h> from EFI header") Signed-off-by: Sui Jingfeng <[email protected]> Reviewed-by: Thomas Zimmermann <[email protected]> Signed-off-by: Thomas Zimmermann <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2023-07-08fbdev/xen-fbfront: Generate deferred I/O opsThomas Zimmermann1-41/+20
Use the existing generator macros to create deferred-I/O helpers for xen-fbfront and set them in the fb_ops structure. Functions for damage handling on memory ranges and areas are provided by the driver. Xen-fbfront's implementation of fb_write writes to system memory, so the generated code can use the respective helper internally. Signed-off-by: Thomas Zimmermann <[email protected]> Reviewed-by: Sam Ravnborg <[email protected]> Acked-by: Helge Deller <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2023-07-08fbdev/xen-fbfront: Select FB_SYS_HELPERS_DEFERREDThomas Zimmermann1-5/+1
The Kconfig token FB_SYS_HELPERS_DEFERRED selects everything that is required for deferred I/O on system-memory framebuffers. Select it from XEN_FBDEV_FRONTEND in favor of the existing identical selection. Signed-off-by: Thomas Zimmermann <[email protected]> Reviewed-by: Sam Ravnborg <[email protected]> Acked-by: Helge Deller <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2023-07-08fbdev/ssd1307fb: Generate deferred I/O opsThomas Zimmermann1-58/+11
Use the existing generator macros to create deferred-I/O helpers for ssd1307fb and set them in the fb_ops structure. Functions for damage handling on memory ranges and areas are provided by the driver. Ssd1307fb's implementation of fb_write writes to system memory, so the generated code can use the respective helper internally. This also fixes a long-standing bug where fb_write returned an errno code instead of the number of written bytes. See the commit message of commit 921b7383f348 ("fbdev: Return number of bytes read or written") for more details. Signed-off-by: Thomas Zimmermann <[email protected]> Reviewed-by: Sam Ravnborg <[email protected]> Acked-by: Helge Deller <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2023-07-08fbdev/ssd1307fb: Select FB_SYS_HELPERS_DEFERREDThomas Zimmermann1-5/+1
The Kconfig token FB_SYS_HELPERS_DEFERRED selects everything that is required for deferred I/O on system-memory framebuffers. Select it from FB_SSD1307 in favor of the existing identical selection. Signed-off-by: Thomas Zimmermann <[email protected]> Reviewed-by: Sam Ravnborg <[email protected]> Acked-by: Helge Deller <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2023-07-08fbdev/metronomefb: Generate deferred I/O opsThomas Zimmermann1-66/+8
Use the existing generator macros to create deferred-I/O helpers for metronomefb and set them in the fb_ops structure. Functions for damage handling on memory ranges and areas are provided by the driver. Metronomefb's implementation of fb_write writes to system memory, so the generated code can use the respective helper internally. This also fixes a long-standing bug where fb_write returned an errno code instead of the number of written bytes. See the commit message of commit 921b7383f348 ("fbdev: Return number of bytes read or written") for more details. Signed-off-by: Thomas Zimmermann <[email protected]> Reviewed-by: Sam Ravnborg <[email protected]> Acked-by: Helge Deller <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2023-07-08fbdev/metronomefb: Select FB_SYS_HELPERS_DEFERREDThomas Zimmermann1-5/+1
The Kconfig token FB_SYS_HELPERS_DEFERRED selects everything that is required for deferred I/O on system-memory framebuffers. Select it from FB_METRONOME in favor of the existing identical selection. Signed-off-by: Thomas Zimmermann <[email protected]> Reviewed-by: Sam Ravnborg <[email protected]> Acked-by: Helge Deller <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2023-07-08fbdev/hecubafb: Generate deferred I/O opsThomas Zimmermann1-70/+8
Use the existing generator macros to create deferred-I/O helpers for hecubafb and set them in the fb_ops structure. Functions for damage handling on memory ranges and areas are provided by the driver. Hecubafb's implementation of fb_write writes to system memory, so the generated code can use the respective helper internally. This also fixes a long-standing bug where fb_write returned an errno code instead of the number of written bytes. See the commit message of commit 921b7383f348 ("fbdev: Return number of bytes read or written") for more details. Signed-off-by: Thomas Zimmermann <[email protected]> Reviewed-by: Sam Ravnborg <[email protected]> Acked-by: Helge Deller <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2023-07-08fbdev/hecubafb: Select FB_SYS_HELPERS_DEFERREDThomas Zimmermann1-6/+1
The Kconfig token FB_SYS_HELPERS_DEFERRED selects everything that is required for deferred I/O on system-memory framebuffers. Select it from FB_HECUBA. Deferred I/O helpers were previously selected by n411, which builds upon hecubafb. Remove these select statements in favor of the new one. N411 does not implement any framebuffer I/O by itself. Signed-off-by: Thomas Zimmermann <[email protected]> Reviewed-by: Sam Ravnborg <[email protected]> Acked-by: Helge Deller <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2023-07-08fbdev/broadsheetfb: Generate deferred I/O opsThomas Zimmermann1-70/+8
Use the existing generator macros to create deferred-I/O helpers for broadsheetfb and set them in the fb_ops structure. Functions for damage handling on memory ranges and areas are provided by the driver. Broadsheedfb's implementation of fb_write writes to system memory, so the generated code can use the respective helper internally. This also fixes a long-standing bug where fb_write returned an errno code instead of the number of written bytes. See the commit message of commit 921b7383f348 ("fbdev: Return number of bytes read or written") for more details. Signed-off-by: Thomas Zimmermann <[email protected]> Reviewed-by: Sam Ravnborg <[email protected]> Acked-by: Helge Deller <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2023-07-08fbdev/broadsheetfb: Select FB_SYS_HELPERS_DEFERREDThomas Zimmermann1-5/+1
The Kconfig token FB_SYS_HELPERS_DEFERRED selects everything that is required for deferred I/O on system-memory framebuffers. Select it from FB_BROADSHEET in favor of the existing identical selection. Signed-off-by: Thomas Zimmermann <[email protected]> Reviewed-by: Sam Ravnborg <[email protected]> Acked-by: Helge Deller <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2023-07-08staging/sm750fb: Do not include <linux/screen_info.h>Thomas Zimmermann4-4/+0
The sm750fb driver does not need anything from <linux/screen_info.h>. Remove the include statements. Signed-off-by: Thomas Zimmermann <[email protected]> Reviewed-by: Javier Martinez Canillas <[email protected]> Cc: Sudip Mukherjee <[email protected]> Cc: Teddy Wang <[email protected]> Reviewed-by: Greg Kroah-Hartman <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2023-07-08fbdev/sm712fb: Do not include <linux/screen_info.h>Thomas Zimmermann1-2/+7
Sm712fb's dependency on <linux/screen_info.h> is artificial in that it only uses struct screen_info for its internals. Replace the use of struct screen_info with a custom data structure and remove the include of <linux/screen_info.h>. Signed-off-by: Thomas Zimmermann <[email protected]> Reviewed-by: Javier Martinez Canillas <[email protected]> Cc: Sudip Mukherjee <[email protected]> Cc: Teddy Wang <[email protected]> Cc: Helge Deller <[email protected]> Reviewed-by: Arnd Bergmann <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2023-07-08efi: Do not include <linux/screen_info.h> from EFI headerThomas Zimmermann2-0/+4
The header file <linux/efi.h> does not need anything from <linux/screen_info.h>. Declare struct screen_info and remove the include statements. Update a number of source files that require struct screen_info's definition. v2: * update loongarch (Jingfeng) Signed-off-by: Thomas Zimmermann <[email protected]> Reviewed-by: Javier Martinez Canillas <[email protected]> Reviewed-by: Sui Jingfeng <[email protected]> Cc: Ard Biesheuvel <[email protected]> Cc: Russell King <[email protected]> Cc: Catalin Marinas <[email protected]> Cc: Will Deacon <[email protected]> Reviewed-by: Arnd Bergmann <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2023-07-07accel/ivpu: Add fw_name file to debugfsKrystian Pradzynski1-0/+10
Add information about currently used firmware, makes test automation of different firmware images easier. Signed-off-by: Krystian Pradzynski <[email protected]> Reviewed-by: Stanislaw Gruszka <[email protected]> Signed-off-by: Stanislaw Gruszka <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2023-07-07accel/ivpu: Print firmware name and versionAndrzej Kacprowski2-4/+13
Firmware file name and version are very important for debugging customer issues - print them as INFO level message instead of DEBUG message that is turned off by default. Signed-off-by: Andrzej Kacprowski <[email protected]> Reviewed-by: Stanislaw Gruszka <[email protected]> Signed-off-by: Stanislaw Gruszka <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2023-07-07accel/ivpu: Add debugfs files for testing device resetStanislaw Gruszka3-0/+43
Add new debugfs files to validate device recovery functionality. Signed-off-by: Stanislaw Gruszka <[email protected]> Reviewed-by: Jacek Lawrynowicz <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2023-07-07accel/ivpu: Add firmware tracing supportStanislaw Gruszka6-3/+404
Add support for firmware tracing and logging via debugfs. Signed-off-by: Stanislaw Gruszka <[email protected]> Reviewed-by: Jacek Lawrynowicz <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2023-07-07accel/ivpu: Initial debugfs supportStanislaw Gruszka4-0/+93
Add initial debugfs support. Provide below functionality: - print buffer objects - print latest boot mode - trigger vpu engine reset Signed-off-by: Stanislaw Gruszka <[email protected]> Reviewed-by: Jacek Lawrynowicz <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2023-07-06drm/nouveau/disp: drop unused argument in nv50_dp_mode_validKarol Herbst4-6/+4
Signed-off-by: Karol Herbst <[email protected]> Reviewed-by: Ben Skeggs <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2023-07-06drm/nouveau/kms: don't call drm_dp_cec_set_edid() on TMDSBen Skeggs1-1/+4
RM complains very loudly at the aux transaction attempts. Signed-off-by: Ben Skeggs <[email protected]> Reviewed-by: Karol Herbst <[email protected]> Reviewed-by: Lyude Paul <[email protected]> Signed-off-by: Karol Herbst <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2023-07-06drm/nouveau/nvif: fix potential double-freeBen Skeggs1-0/+3
DRM cleanup paths unconditionally call nvif_mmu_dtor() for clients, which would result in a double-free if nvif_mmu_ctor()'d previously failed. Signed-off-by: Ben Skeggs <[email protected]> Reviewed-by: Lyude Paul <[email protected]> Signed-off-by: Karol Herbst <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2023-07-06drm/nouveau/fifo/ga100-: add per-runlist nonstall intr handlingBen Skeggs13-29/+116
GSP-RM will enforce this, so implement on HW too so we can share code. Signed-off-by: Ben Skeggs <[email protected]> Reviewed-by: Karol Herbst <[email protected]> Reviewed-by: Lyude Paul <[email protected]> Signed-off-by: Karol Herbst <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2023-07-06drm/nouveau/fifo/ga100-: remove individual runlists rather than failing oneinitBen Skeggs1-11/+35
We're adding better support for the non-stall interrupt, which will need to fetch the interrupt vector from the runlist's primary engine. NVKM doesn't support all target engines (ie. NVDEC etc), and it wouldn't be ideal to completely fail initialisation in this case. Instead. Remove runlists where we can't determine all the needed info. Signed-off-by: Ben Skeggs <[email protected]> Reviewed-by: Karol Herbst <[email protected]> Reviewed-by: Lyude Paul <[email protected]> Signed-off-by: Karol Herbst <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2023-07-06drm/nouveau/fifo: return ERR_PTR from nvkm_runl_new()Ben Skeggs1-2/+2
Callers expect this - not NULL. Signed-off-by: Ben Skeggs <[email protected]> Reviewed-by: Karol Herbst <[email protected]> Reviewed-by: Lyude Paul <[email protected]> Signed-off-by: Karol Herbst <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2023-07-06drm/nouveau/fifo: remove left-over references to nvkm_fifo_chanBen Skeggs32-47/+37
This was renamed to nvkm_chan in the host rework. Signed-off-by: Ben Skeggs <[email protected]> Reviewed-by: Karol Herbst <[email protected]> Reviewed-by: Lyude Paul <[email protected]> Signed-off-by: Karol Herbst <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2023-07-06drm/nouveau/fb/ga102-: construct vidmem heap via new gp102 pathsBen Skeggs4-43/+8
No need for custom implementation anymore. Signed-off-by: Ben Skeggs <[email protected]> Reviewed-by: Lyude Paul <[email protected]> Signed-off-by: Karol Herbst <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2023-07-06drm/nouveau/fb/gp102-ga100: switch to simpler vram size detection methodBen Skeggs10-4/+72
Also exposes this for use by upcoming GSP-RM initialisation code. v2: add SPDX header Signed-off-by: Ben Skeggs <[email protected]> Reviewed-by: Lyude Paul <[email protected]> Signed-off-by: Karol Herbst <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2023-07-06drm/nouveau/nvkm: punt spurious irq messages to debug levelBen Skeggs1-2/+2
This can be completely normal in some situations (ie. non-stall intrs when nothing is waiting on them). Signed-off-by: Ben Skeggs <[email protected]> Reviewed-by: Karol Herbst <[email protected]> Reviewed-by: Lyude Paul <[email protected]> Signed-off-by: Karol Herbst <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2023-07-06drm/nouveau/nvkm: fini object children in reverse orderBen Skeggs1-1/+1
Turns out, we're currently tearing down the disp core channel *before* the satellite channels (wndw, etc) during suspend. This makes RM return NV_ERR_NOT_SUPPORTED on attempting to reallocate the core channel on resume for some reason, but we probably shouldn't be doing it on HW either. Tear down children in the reverse of allocation order instead. Signed-off-by: Ben Skeggs <[email protected]> Reviewed-by: Karol Herbst <[email protected]> Reviewed-by: Lyude Paul <[email protected]> Signed-off-by: Karol Herbst <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2023-07-05drm: Add kms driver for loongson display controllerSui Jingfeng32-0/+6491
Loongson display controller IP has been integrated in both Loongson north bridge chipset (ls7a1000/ls7a2000) and Loongson SoCs (ls2k1000/ls2k2000). It has even been included in Loongson's BMC products. It has two display pipes, and each display pipe supports a primary plane and a cursor plane. For the DC in the LS7a1000, each display pipe has a DVO output interface, which is able to support 1920x1080@60Hz. For the DC in the LS7A2000, each display pipe is equipped with a built-in HDMI encoder, which is compliant with the HDMI 1.4 specification. The first display pipe is also equipped with a transparent VGA encoder, which is parallel with the HDMI encoder. To get a decent performance for writing framebuffer data to the VRAM, the write combine support should be enabled. v1 -> v2: 1) Use hpd status reg when polling for ls7a2000. 2) Fix all warnings that emerged when compiling with W=1. v2 -> v3: 1) Add COMPILE_TEST to Kconfig and make the driver off by default 2) Alphabetical sorting headers (Thomas) 3) Untangle register access functions as much as possible (Thomas) 4) Switch to TTM-based memory manager (Thomas) 5) Add the chip ID detection function which can be used to distinguish chip models 6) Revise the built-in HDMI phy driver, nearly all main stream mode below 4K@30Hz is tested, and this driver supports clone(mirror) display mode and extend(joint) display mode. v3 -> v4: 1) Quickly fix a small mistake. v4 -> v5: 1) Add per display pipe debugfs support to the builtin HDMI encoder. v5 -> v6: 1) Remove stray code which didn't get used, say lsdc_of_get_reserved_ram 2) Fix all typos I could found, make sentences and code more readable 3) Untangle lsdc_hdmi*_connector_detect() function according to the pipe 4) Rename this driver as loongson. v6 -> v7: 1) Add prime support for buffer self-sharing, sharing buffer with drm/etnaviv is also tested and it works with limitations. 2) Implement buffer object tracking with list_head. 3) Add S3(sleep to RAM) support 4) Rewrite lsdc_bo_move since TTM core stop allocating resources     during BO creation. Patch V1 ~ V6 of this series no longer work.     Thus, we send V7. v7 -> v8:  1) Zero a compile warning on a 32-bit platform, compile with W=1  2) Revise lsdc_bo_gpu_offset() and make minor cleanups.  3) Pageflip tested on the virtual terminal with the following commands: modetest -M loongson -s 32:1920x1080 -v modetest -M loongson -s 34:1920x1080 -v -F tiles It works like a charm, when running the pageflip test with dual screens configuration, another two additional BOs were created by the modetest, VRAM usage up to 40+ MB, well we have at least 64MB, still enough. # cat bos bo[0000]: size: 8112kB VRAM bo[0001]: size: 16kB VRAM bo[0002]: size: 16kB VRAM bo[0003]: size: 16208kB VRAM bo[0004]: size: 8112kB VRAM bo[0005]: size: 8112kB VRAM v8 -> v9: 1) Select I2C and I2C_ALGOBIT in Kconfig, should depend on MMU. 2) Using pci_get_domain_bus_and_slot to get the GPU device. v9 -> v10: 1) Revise lsdc_drm_freeze() to implement S3 correctly. We realized that the pinned BO could not be moved, the VRAM lost power when sleeping to RAM. Thus, the data in the buffer who is pinned in VRAM will get lost when resumed. Yet it's not a big problem because this driver relies on the CPU to update the front framebuffer. We can see the garbage data when resume from S3, but the screen will show the right image as I move the cursor. This is due to the CPU repaint. v10 of this patch makes S3 perfect by unpin all of the BOs in VRAM, evict them all to system RAM in lsdc_drm_freeze(). v10 -> v11: 1) On a double-screen case, The buffer object backing the single giant framebuffer is referenced by two GEM objects; hence, it will be pinned at least twice by prepare_fb() function. This causes its pin count > 1. V10 of this patch only unpins VRAM BOs once when suspend, which is not correct on double-screen case. V11 of this patch unpin the BOs until its pin count reaches zero when suspend. Then, we make the S3 support complete finally. With v11, I can't see any garbage data when resume. 2) Fix vblank wait timeout when disable CRTC. 3) Test against IGT, at least fbdev test and kms_flip test passed. 4) Rewrite pixel PLL update function, magic numbers eliminated (Emil) 5) Drop a few common hardware features description in lsdc_desc (Emil) 6) Drop lsdc_mode_config_mode_valid(), instead add restrictions in dumb create function. (Emil) 7) Untangle the ls7a1000 case and ls7a2000 case completely (Thomas) v11 -> v12: none v12 -> v13: 1) Add benchmarks to figure out the bandwidth of the hardware platform. Usage: # cd /sys/kernel/debug/dri/0/ # cat benchmark 2) VRAM is filled with garbage data if uninitialized, add a buffer clearing procedure (lsdc_bo_clear), clear the BO on creation time. 3) Update copyrights and adjust coding style (Huacai) v13 -> v14: 1) Trying to add async update support for cursor plane. v14 -> v15: 1) Add lsdc_vga_set_decode() funciton, which allow us remove multi-video cards workaround, now it allow drm/loongson, drm/amdgpu, drm/etnaviv co-exist in the system, more is also possible (Emil and Xuerui) 2) Fix typos and grammar mistakes as much as possible (Xuerui) 3) Unify copyrights as GPL-2.0+ (Xuerui) 4) Fix a bug introduce since V13, TTM may import BO from other drivers, we shouldn't clear it on such a case. Cc: Maarten Lankhorst <[email protected]> Cc: Maxime Ripard <[email protected]> Cc: Thomas Zimmermann <[email protected]> Cc: David Airlie <[email protected]> Cc: Daniel Vetter <[email protected]> Cc: Sumit Semwal <[email protected]> Cc: "Christian König" <[email protected]> Cc: Nathan Chancellor <[email protected]> Cc: Emil Velikov <[email protected]> Cc: Geert Uytterhoeven <[email protected]> Cc: [email protected] Tested-by: Liu Peibao <[email protected]> Tested-by: Li Yi  <[email protected]> Acked-by: Thomas Zimmermann <[email protected]> Signed-off-by: Sui Jingfeng <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]