Christian König [Tue, 19 Apr 2022 12:33:39 +0000 (14:33 +0200)]
drm/amdgpu: use drm_exec for GEM and CSA handling v2
Start using the new component here as well.
v2: ignore duplicates to allow per VM BO mappings
Signed-off-by: Christian König <christian.koenig@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230711133122.3710-5-christian.koenig@amd.com
Christian König [Tue, 19 Apr 2022 10:21:45 +0000 (12:21 +0200)]
drm/amdkfd: switch over to using drm_exec v3
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 <christian.koenig@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230711133122.3710-4-christian.koenig@amd.com
Christian König [Wed, 13 Apr 2022 14:09:00 +0000 (16:09 +0200)]
drm: add drm_exec selftests v4
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 <christian.koenig@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230711133122.3710-3-christian.koenig@amd.com
Christian König [Thu, 7 Apr 2022 06:17:51 +0000 (08:17 +0200)]
drm: execution context for GEM buffers v7
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 <christian.koenig@amd.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Danilo Krummrich <dakr@redhat.com>
Tested-by: Danilo Krummrich <dakr@redhat.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230711133122.3710-2-christian.koenig@amd.com
Thomas Zimmermann [Mon, 10 Jul 2023 07:58:38 +0000 (09:58 +0200)]
fbdev/hyperv_fb: Include <linux/screen_info.h>
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 <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/
202307101042.rqehuauj-lkp@intel.com/
Fixes:
8b0d13545b09 ("efi: Do not include <linux/screen_info.h> from EFI header")
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Cc: "K. Y. Srinivasan" <kys@microsoft.com> (supporter:Hyper-V/Azure CORE AND DRIVERS)
Cc: Haiyang Zhang <haiyangz@microsoft.com> (supporter:Hyper-V/Azure CORE AND DRIVERS)
Cc: Wei Liu <wei.liu@kernel.org> (supporter:Hyper-V/Azure CORE AND DRIVERS)
Cc: Dexuan Cui <decui@microsoft.com> (supporter:Hyper-V/Azure CORE AND DRIVERS)
Cc: Helge Deller <deller@gmx.de> (maintainer:FRAMEBUFFER LAYER)
Cc: Javier Martinez Canillas <javierm@redhat.com>
Cc: Sui Jingfeng <suijingfeng@loongson.cn>
Cc: Ard Biesheuvel <ardb@kernel.org>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will@kernel.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: linux-efi@vger.kernel.org
Cc: linux-hyperv@vger.kernel.org (open list:Hyper-V/Azure CORE AND DRIVERS)
Cc: linux-fbdev@vger.kernel.org (open list:FRAMEBUFFER LAYER)
Cc: dri-devel@lists.freedesktop.org (open list:FRAMEBUFFER LAYER)
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Reviewed-by: Sui Jingfeng <suijingfeng@loongson.cn>
Link: https://patchwork.freedesktop.org/patch/msgid/20230710075848.23087-1-tzimmermann@suse.de
Javier Martinez Canillas [Mon, 3 Jul 2023 23:05:27 +0000 (01:05 +0200)]
drm/arm: Make ARM devices menu depend on DRM
Otherwise if CONFIG_DRM is disabled, menuconfig will show an empty menu.
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Acked-by: Liviu Dudau <liviu.dudau@arm.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230703230534.997525-4-javierm@redhat.com
Rajneesh Bhardwaj [Sat, 8 Jul 2023 01:13:55 +0000 (21:13 -0400)]
drm/ttm: Use init_on_free to delay release TTM BOs
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 <rajneesh.bhardwaj@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>.
Link: https://patchwork.freedesktop.org/patch/msgid/20230708011355.853-1-rajneesh.bhardwaj@amd.com
Signed-off-by: Christian König <christian.koenig@amd.com>
Nikhil Devshatwar [Tue, 6 Jun 2023 08:21:42 +0000 (13:51 +0530)]
drm/bridge: cdns-mhdp8546: Fix the interrupt enable/disable
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 <nikhil.nd@ti.com>
Reviewed-by: Swapnil Jakhade <sjakhade@cadence.com>
Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Signed-off-by: Aradhya Bhatia <a-bhatia1@ti.com>
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230606082142.23760-9-a-bhatia1@ti.com
Aradhya Bhatia [Tue, 6 Jun 2023 08:21:41 +0000 (13:51 +0530)]
drm/tidss: Update encoder/bridge chain connect model
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 <a-bhatia1@ti.com>
Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230606082142.23760-8-a-bhatia1@ti.com
Aradhya Bhatia [Tue, 6 Jun 2023 08:21:40 +0000 (13:51 +0530)]
drm/bridge: sii902x: Set input_bus_flags in atomic_check
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 <a-bhatia1@ti.com>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230606082142.23760-7-a-bhatia1@ti.com
Aradhya Bhatia [Tue, 6 Jun 2023 08:21:39 +0000 (13:51 +0530)]
drm/bridge: sii902x: Support format negotiation hooks
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 <a-bhatia1@ti.com>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230606082142.23760-6-a-bhatia1@ti.com
Nikhil Devshatwar [Tue, 6 Jun 2023 08:21:38 +0000 (13:51 +0530)]
drm/bridge: mhdp8546: Set input_bus_flags from atomic_check
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 <nikhil.nd@ti.com>
[a-bhatia1: replace timings in cdns_mhdp_platform_info by input_bus_flags]
Signed-off-by: Aradhya Bhatia <a-bhatia1@ti.com>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230606082142.23760-5-a-bhatia1@ti.com
Nikhil Devshatwar [Tue, 6 Jun 2023 08:21:37 +0000 (13:51 +0530)]
drm/bridge: mhdp8546: Add minimal format negotiation
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 <nikhil.nd@ti.com>
[a-bhatia1: Drop the output_fmt check condition]
Signed-off-by: Aradhya Bhatia <a-bhatia1@ti.com>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230606082142.23760-4-a-bhatia1@ti.com
Nikhil Devshatwar [Tue, 6 Jun 2023 08:21:36 +0000 (13:51 +0530)]
drm/bridge: tfp410: Set input_bus_flags in atomic_check
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 <nikhil.nd@ti.com>
Signed-off-by: Aradhya Bhatia <a-bhatia1@ti.com>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230606082142.23760-3-a-bhatia1@ti.com
Nikhil Devshatwar [Tue, 6 Jun 2023 08:21:35 +0000 (13:51 +0530)]
drm/bridge: tfp410: Support format negotiation hooks
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 <nikhil.nd@ti.com>
[a-bhatia1: Removed output fmt condition check]
Signed-off-by: Aradhya Bhatia <a-bhatia1@ti.com>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230606082142.23760-2-a-bhatia1@ti.com
Christophe JAILLET [Sat, 8 Jul 2023 06:05:35 +0000 (08:05 +0200)]
drm/bridge: tc358767: Use devm_clk_get_enabled() helper
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 <christophe.jaillet@wanadoo.fr>
Reviewed-by: Andrzej Hajda <andrzej.hajda@intel.com>
Signed-off-by: Robert Foss <rfoss@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/208a15ce4e01973daf039ad7bc0f9241f650b3af.1672415956.git.christophe.jaillet@wanadoo.fr
Simon Ser [Tue, 20 Jun 2023 18:15:51 +0000 (18:15 +0000)]
drm/nouveau/disp: use drm_kms_helper_connector_hotplug_event()
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 <contact@emersion.fr>
Cc: Ben Skeggs <bskeggs@redhat.com>
Cc: Lyude Paul <lyude@redhat.com>
Cc: David Airlie <airlied@linux.ie>
Cc: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230620181547.272476-1-contact@emersion.fr
Simon Ser [Fri, 5 Feb 2021 22:41:40 +0000 (23:41 +0100)]
nouveau/dispnv50: add cursor pitch check
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 <contact@emersion.fr>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: Ben Skeggs <bskeggs@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210205224140.28174-1-contact@emersion.fr
Gurchetan Singh [Fri, 7 Jul 2023 21:31:24 +0000 (14:31 -0700)]
drm/virtio: Conditionally allocate virtio_gpu_fence
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 <gurchetansingh@chromium.org>
Reviewed-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Tested-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com> # edited coding style
Link: https://patchwork.freedesktop.org/patch/msgid/20230707213124.494-1-gurchetansingh@chromium.org
Sui Jingfeng [Sun, 9 Jul 2023 10:05:14 +0000 (18:05 +0800)]
drm/hyperv: Fix a compilation issue because of not including screen_info.h
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 <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/
202307090823.nxnT8Kk5-lkp@intel.com/
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 <suijingfeng@loongson.cn>
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20230709100514.703759-1-suijingfeng@loongson.cn
Thomas Zimmermann [Thu, 6 Jul 2023 15:08:53 +0000 (17:08 +0200)]
fbdev/xen-fbfront: Generate deferred I/O ops
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 <tzimmermann@suse.de>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Acked-by: Helge Deller <deller@gmx.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20230706151432.20674-11-tzimmermann@suse.de
Thomas Zimmermann [Thu, 6 Jul 2023 15:08:52 +0000 (17:08 +0200)]
fbdev/xen-fbfront: Select FB_SYS_HELPERS_DEFERRED
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 <tzimmermann@suse.de>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Acked-by: Helge Deller <deller@gmx.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20230706151432.20674-10-tzimmermann@suse.de
Thomas Zimmermann [Thu, 6 Jul 2023 15:08:51 +0000 (17:08 +0200)]
fbdev/ssd1307fb: Generate deferred I/O ops
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 <tzimmermann@suse.de>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Acked-by: Helge Deller <deller@gmx.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20230706151432.20674-9-tzimmermann@suse.de
Thomas Zimmermann [Thu, 6 Jul 2023 15:08:50 +0000 (17:08 +0200)]
fbdev/ssd1307fb: Select FB_SYS_HELPERS_DEFERRED
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 <tzimmermann@suse.de>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Acked-by: Helge Deller <deller@gmx.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20230706151432.20674-8-tzimmermann@suse.de
Thomas Zimmermann [Thu, 6 Jul 2023 15:08:49 +0000 (17:08 +0200)]
fbdev/metronomefb: Generate deferred I/O ops
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 <tzimmermann@suse.de>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Acked-by: Helge Deller <deller@gmx.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20230706151432.20674-7-tzimmermann@suse.de
Thomas Zimmermann [Thu, 6 Jul 2023 15:08:48 +0000 (17:08 +0200)]
fbdev/metronomefb: Select FB_SYS_HELPERS_DEFERRED
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 <tzimmermann@suse.de>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Acked-by: Helge Deller <deller@gmx.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20230706151432.20674-6-tzimmermann@suse.de
Thomas Zimmermann [Thu, 6 Jul 2023 15:08:47 +0000 (17:08 +0200)]
fbdev/hecubafb: Generate deferred I/O ops
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 <tzimmermann@suse.de>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Acked-by: Helge Deller <deller@gmx.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20230706151432.20674-5-tzimmermann@suse.de
Thomas Zimmermann [Thu, 6 Jul 2023 15:08:46 +0000 (17:08 +0200)]
fbdev/hecubafb: Select FB_SYS_HELPERS_DEFERRED
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 <tzimmermann@suse.de>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Acked-by: Helge Deller <deller@gmx.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20230706151432.20674-4-tzimmermann@suse.de
Thomas Zimmermann [Thu, 6 Jul 2023 15:08:45 +0000 (17:08 +0200)]
fbdev/broadsheetfb: Generate deferred I/O ops
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 <tzimmermann@suse.de>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Acked-by: Helge Deller <deller@gmx.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20230706151432.20674-3-tzimmermann@suse.de
Thomas Zimmermann [Thu, 6 Jul 2023 15:08:44 +0000 (17:08 +0200)]
fbdev/broadsheetfb: Select FB_SYS_HELPERS_DEFERRED
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 <tzimmermann@suse.de>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Acked-by: Helge Deller <deller@gmx.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20230706151432.20674-2-tzimmermann@suse.de
Thomas Zimmermann [Thu, 6 Jul 2023 10:42:17 +0000 (12:42 +0200)]
staging/sm750fb: Do not include <linux/screen_info.h>
The sm750fb driver does not need anything from <linux/screen_info.h>.
Remove the include statements.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Cc: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Cc: Teddy Wang <teddy.wang@siliconmotion.com>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20230706104852.27451-5-tzimmermann@suse.de
Thomas Zimmermann [Thu, 6 Jul 2023 10:42:16 +0000 (12:42 +0200)]
sysfb: Do not include <linux/screen_info.h> from sysfb header
The header file <linux/sysfb.h> does not need anything from
<linux/screen_info.h>. Declare struct screen_info and remove
the include statements.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Reviewed-by: Sui Jingfeng <suijingfeng@loongson.cn>
Cc: Ard Biesheuvel <ardb@kernel.org>
Cc: Hans de Goede <hdegoede@redhat.com>
Cc: Javier Martinez Canillas <javierm@redhat.com>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20230706104852.27451-4-tzimmermann@suse.de
Thomas Zimmermann [Thu, 6 Jul 2023 10:42:15 +0000 (12:42 +0200)]
fbdev/sm712fb: Do not include <linux/screen_info.h>
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 <tzimmermann@suse.de>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Cc: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Cc: Teddy Wang <teddy.wang@siliconmotion.com>
Cc: Helge Deller <deller@gmx.de>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20230706104852.27451-3-tzimmermann@suse.de
Thomas Zimmermann [Thu, 6 Jul 2023 10:42:14 +0000 (12:42 +0200)]
efi: Do not include <linux/screen_info.h> from EFI header
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 <tzimmermann@suse.de>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Reviewed-by: Sui Jingfeng <suijingfeng@loongson.cn>
Cc: Ard Biesheuvel <ardb@kernel.org>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will@kernel.org>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20230706104852.27451-2-tzimmermann@suse.de
Krystian Pradzynski [Wed, 24 May 2023 07:48:47 +0000 (09:48 +0200)]
accel/ivpu: Add fw_name file to debugfs
Add information about currently used firmware, makes test
automation of different firmware images easier.
Signed-off-by: Krystian Pradzynski <krystian.pradzynski@linux.intel.com>
Reviewed-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com>
Signed-off-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230524074847.866711-6-stanislaw.gruszka@linux.intel.com
Andrzej Kacprowski [Wed, 24 May 2023 07:48:46 +0000 (09:48 +0200)]
accel/ivpu: Print firmware name and version
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 <andrzej.kacprowski@linux.intel.com>
Reviewed-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com>
Signed-off-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230524074847.866711-5-stanislaw.gruszka@linux.intel.com
Stanislaw Gruszka [Wed, 24 May 2023 07:48:45 +0000 (09:48 +0200)]
accel/ivpu: Add debugfs files for testing device reset
Add new debugfs files to validate device recovery functionality.
Signed-off-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com>
Reviewed-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230524074847.866711-4-stanislaw.gruszka@linux.intel.com
Stanislaw Gruszka [Wed, 24 May 2023 07:48:44 +0000 (09:48 +0200)]
accel/ivpu: Add firmware tracing support
Add support for firmware tracing and logging via debugfs.
Signed-off-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com>
Reviewed-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230524074847.866711-3-stanislaw.gruszka@linux.intel.com
Stanislaw Gruszka [Wed, 24 May 2023 07:48:43 +0000 (09:48 +0200)]
accel/ivpu: Initial debugfs support
Add initial debugfs support. Provide below functionality:
- print buffer objects
- print latest boot mode
- trigger vpu engine reset
Signed-off-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com>
Reviewed-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230524074847.866711-2-stanislaw.gruszka@linux.intel.com
Karol Herbst [Wed, 28 Jun 2023 21:22:47 +0000 (23:22 +0200)]
drm/nouveau/disp: drop unused argument in nv50_dp_mode_valid
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Ben Skeggs <bskeggs@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230628212248.3798605-2-kherbst@redhat.com
Ben Skeggs [Thu, 25 May 2023 00:31:06 +0000 (10:31 +1000)]
drm/nouveau/kms: don't call drm_dp_cec_set_edid() on TMDS
RM complains very loudly at the aux transaction attempts.
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230525003106.3853741-10-skeggsb@gmail.com
Ben Skeggs [Thu, 25 May 2023 00:31:05 +0000 (10:31 +1000)]
drm/nouveau/nvif: fix potential double-free
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 <bskeggs@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230525003106.3853741-9-skeggsb@gmail.com
Ben Skeggs [Thu, 25 May 2023 00:31:04 +0000 (10:31 +1000)]
drm/nouveau/fifo/ga100-: add per-runlist nonstall intr handling
GSP-RM will enforce this, so implement on HW too so we can share code.
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230525003106.3853741-8-skeggsb@gmail.com
Ben Skeggs [Thu, 25 May 2023 00:31:03 +0000 (10:31 +1000)]
drm/nouveau/fifo/ga100-: remove individual runlists rather than failing oneinit
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 <bskeggs@redhat.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230525003106.3853741-7-skeggsb@gmail.com
Ben Skeggs [Thu, 25 May 2023 00:31:02 +0000 (10:31 +1000)]
drm/nouveau/fifo: return ERR_PTR from nvkm_runl_new()
Callers expect this - not NULL.
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230525003106.3853741-6-skeggsb@gmail.com
Ben Skeggs [Thu, 25 May 2023 00:31:01 +0000 (10:31 +1000)]
drm/nouveau/fifo: remove left-over references to nvkm_fifo_chan
This was renamed to nvkm_chan in the host rework.
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230525003106.3853741-5-skeggsb@gmail.com
Ben Skeggs [Thu, 25 May 2023 00:31:00 +0000 (10:31 +1000)]
drm/nouveau/fb/ga102-: construct vidmem heap via new gp102 paths
No need for custom implementation anymore.
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230525003106.3853741-4-skeggsb@gmail.com
Ben Skeggs [Thu, 25 May 2023 00:30:59 +0000 (10:30 +1000)]
drm/nouveau/fb/gp102-ga100: switch to simpler vram size detection method
Also exposes this for use by upcoming GSP-RM initialisation code.
v2: add SPDX header
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230525003106.3853741-3-skeggsb@gmail.com
Ben Skeggs [Thu, 25 May 2023 00:30:58 +0000 (10:30 +1000)]
drm/nouveau/nvkm: punt spurious irq messages to debug level
This can be completely normal in some situations (ie. non-stall intrs
when nothing is waiting on them).
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230525003106.3853741-2-skeggsb@gmail.com
Ben Skeggs [Thu, 25 May 2023 00:30:57 +0000 (10:30 +1000)]
drm/nouveau/nvkm: fini object children in reverse order
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 <bskeggs@redhat.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230525003106.3853741-1-skeggsb@gmail.com
John Stultz [Fri, 30 Jun 2023 16:20:33 +0000 (16:20 +0000)]
MAINTAINERS: Remove Laura Abbott from DMA-BUF HEAPS FRAMEWORK
Laura's email address has not been valid for quite awhile now,
so wanted to clean up the reviewer list here.
I reached out to Laura who said it made sense to drop her from
the list, so this patch does that.
I do want to recognize Laura's long time contribution to this
area and her previous ION maintainership, as this couldn't
have gone upstream without her prior efforts. Many thanks!
Cc: Laura Abbott <labbott@kernel.org>
Cc: T.J. Mercier <tjmercier@google.com>
Cc: Sumit Semwal <sumit.semwal@linaro.org>
Cc: Benjamin Gaignard <benjamin.gaignard@collabora.com>
Cc: Brian Starkey <Brian.Starkey@arm.com>
Cc: John Stultz <jstultz@google.com>
Cc: linux-media@vger.kernel.org
Cc: dri-devel@lists.freedesktop.org
Cc: linaro-mm-sig@lists.linaro.org
Cc: kernel-team@android.com
Acked-by: Laura Abbott <labbott@kernel.org>
Signed-off-by: John Stultz <jstultz@google.com>
Reviewed-by: T.J. Mercier <tjmercier@google.com>
Signed-off-by: Sumit Semwal <sumit.semwal@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20230630162111.3051783-1-jstultz@google.com
Sui Jingfeng [Thu, 15 Jun 2023 14:36:13 +0000 (22:36 +0800)]
MAINTAINERS: add maintainers for DRM LOONGSON driver
This patch add Sui Jingfeng as maintainer to drm/loongson driver.
Signed-off-by: Sui Jingfeng <suijingfeng@loongson.cn>
Acked-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20230615143613.1236245-3-15330273260@189.cn
Sui Jingfeng [Thu, 15 Jun 2023 14:36:12 +0000 (22:36 +0800)]
drm: Add kms driver for loongson display controller
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 <maarten.lankhorst@linux.intel.com>
Cc: Maxime Ripard <mripard@kernel.org>
Cc: Thomas Zimmermann <tzimmermann@suse.de>
Cc: David Airlie <airlied@gmail.com>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: Sumit Semwal <sumit.semwal@linaro.org>
Cc: "Christian König" <christian.koenig@amd.com>
Cc: Nathan Chancellor <nathan@kernel.org>
Cc: Emil Velikov <emil.l.velikov@gmail.com>
Cc: Geert Uytterhoeven <geert+renesas@glider.be>
Cc: loongson-kernel@lists.loongnix.cn
Tested-by: Liu Peibao <liupeibao@loongson.cn>
Tested-by: Li Yi <liyi@loongson.cn>
Acked-by: Thomas Zimmermann <tzimmermann@suse.de>
Signed-off-by: Sui Jingfeng <suijingfeng@loongson.cn>
Link: https://patchwork.freedesktop.org/patch/msgid/20230615143613.1236245-2-15330273260@189.cn
Sui Jingfeng [Thu, 22 Jun 2023 10:18:57 +0000 (18:18 +0800)]
drm/drm_gem.c: Remove surplus else after return
else is not generally useful after return
Signed-off-by: Sui Jingfeng <suijingfeng@loongson.cn>
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20230622101857.2298773-1-suijingfeng@loongson.cn
Julia Lawall [Tue, 27 Jun 2023 14:43:18 +0000 (16:43 +0200)]
drm/gud: use vmalloc_array and vcalloc
Use vmalloc_array and vcalloc to protect against
multiplication overflows.
The changes were done using the following Coccinelle
semantic patch:
// <smpl>
@initialize:ocaml@
@@
let rename alloc =
match alloc with
"vmalloc" -> "vmalloc_array"
| "vzalloc" -> "vcalloc"
| _ -> failwith "unknown"
@@
size_t e1,e2;
constant C1, C2;
expression E1, E2, COUNT, x1, x2, x3;
typedef u8;
typedef __u8;
type t = {u8,__u8,char,unsigned char};
identifier alloc = {vmalloc,vzalloc};
fresh identifier realloc = script:ocaml(alloc) { rename alloc };
@@
(
alloc(x1*x2*x3)
|
alloc(C1 * C2)
|
alloc((sizeof(t)) * (COUNT), ...)
|
- alloc((e1) * (e2))
+ realloc(e1, e2)
|
- alloc((e1) * (COUNT))
+ realloc(COUNT, e1)
|
- alloc((E1) * (E2))
+ realloc(E1, E2)
)
// </smpl>
Signed-off-by: Julia Lawall <Julia.Lawall@inria.fr>
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20230627144339.144478-4-Julia.Lawall@inria.fr
Marek Vasut [Thu, 15 Jun 2023 20:15:11 +0000 (22:15 +0200)]
drm: bridge: samsung-dsim: Drain command transfer FIFO before transfer
Wait until the command transfer FIFO is empty before loading in the next
command. The previous behavior where the code waited until command transfer
FIFO was not full suffered from transfer corruption, where the last command
in the FIFO could be overwritten in case the FIFO indicates not full, but
also does not have enough space to store another transfer yet.
Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
Tested-by: Jagan Teki <jagan@amarulasolutions.com> # imx8mm-icore
Link: https://patchwork.freedesktop.org/patch/msgid/20230615201511.565923-1-marex@denx.de
John Stultz [Fri, 30 Jun 2023 04:52:23 +0000 (04:52 +0000)]
MAINTAINERS: Add T.J. Mercier as reviewer for DMA-BUF HEAPS FRAMEWORK
T.J. has been responsible for dmab-buf items on the Android team
for awhile now, so it would be great to have him on as a reviewer.
Cc: T.J. Mercier <tjmercier@google.com>
Cc: Sumit Semwal <sumit.semwal@linaro.org>
Cc: Benjamin Gaignard <benjamin.gaignard@collabora.com>
Cc: Brian Starkey <Brian.Starkey@arm.com>
Cc: John Stultz <jstultz@google.com>
Cc: linux-media@vger.kernel.org
Cc: dri-devel@lists.freedesktop.org
Cc: linaro-mm-sig@lists.linaro.org
Cc: kernel-team@android.com
Signed-off-by: John Stultz <jstultz@google.com>
Acked-by: Sumit Semwal <sumit.semwal@linaro.org>
Signed-off-by: Sumit Semwal <sumit.semwal@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20230630045246.1674919-1-jstultz@google.com
Jeffrey Hugo [Wed, 28 Jun 2023 18:05:34 +0000 (12:05 -0600)]
MAINTAINERS: Remove Liam Mark from DMA-BUF HEAPS FRAMEWORK
@codeaurora.org email addresses are no longer valid and will bounce.
I reached out to Liam about updating his entry under DMA-BUF HEAPS
FRAMEWORK with an @codeaurora.org address. His response:
"I am not a maintainer anymore, that should be removed."
Liam currently does not have an email address that can be used to remove
this entry, so I offered to submit a cleanup on his behalf with Liam's
consent.
Signed-off-by: Jeffrey Hugo <quic_jhugo@quicinc.com>
Acked-by: John Stultz <jstultz@google.com>
Signed-off-by: Sumit Semwal <sumit.semwal@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20230628180534.31819-1-quic_jhugo@quicinc.com
Ralph Campbell [Wed, 21 Jun 2023 06:19:03 +0000 (23:19 -0700)]
drm/edid: Add quirk for OSVR HDK 2.0
The OSVR virtual reality headset HDK 2.0 uses a different EDID
vendor and device identifier than the HDK 1.1 - 1.4 headsets.
Add the HDK 2.0 vendor and device identifier to the quirks table so
that window managers do not try to display the desktop screen on the
headset display.
Closes: https://gitlab.freedesktop.org/drm/misc/-/issues/30
Signed-off-by: Ralph Campbell <rcampbell@nvidia.com>
Tested-by: Ralph Campbell <rcampbell@nvidia.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230621061903.3422648-1-rcampbell@nvidia.com
Carlos Eduardo Gallo Filho [Sat, 24 Jun 2023 21:29:05 +0000 (18:29 -0300)]
drm/tests: Fix swapped drm_framebuffer tests parameter names
Swap tests parameters names so they actually reflect what is being tested.
Signed-off-by: Carlos Eduardo Gallo Filho <gcarlos@disroot.org>
Reviewed-by: André Almeida <andrealmeid@igalia.com>
Reviewed-by: Maíra Canal <mairacanal@riseup.net>
Signed-off-by: Maíra Canal <mairacanal@riseup.net>
Link: https://patchwork.freedesktop.org/patch/msgid/20230624212905.21338-1-gcarlos@disroot.org
Colin Ian King [Tue, 27 Jun 2023 17:01:09 +0000 (18:01 +0100)]
drm/edid: make read-only const array static
Don't populate the const array on the stack, instead make it static.
Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230627170109.751829-1-colin.i.king@gmail.com
Thomas Zimmermann [Wed, 21 Jun 2023 12:53:48 +0000 (14:53 +0200)]
drm/ast: Merge config and chip detection
Detection of the configuration mode and the chipset model are
linked to each other. One uses values from the other; namely the
PCI device revision and the SCU revision. Merge this code into
a single function.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com>
Tested-by: Jocelyn Falempe <jfalempe@redhat.com> # AST2600
Reviewed-by: Sui Jingfeng <suijingfeng@loongson.cn>
Link: https://patchwork.freedesktop.org/patch/msgid/20230621130032.3568-15-tzimmermann@suse.de
Thomas Zimmermann [Wed, 21 Jun 2023 12:53:47 +0000 (14:53 +0200)]
drm/ast: Move widescreen and tx-chip detection into separate helpers
Split ast_detect_chip() into three functions and call them one by
one. The new functions detect the transmitter chip and widescreen
support. This will allow for further refactoring.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Sui Jingfeng <suijingfeng@loongson.cn>
Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com>
Tested-by: Jocelyn Falempe <jfalempe@redhat.com> # AST2600
Tested-by: Sui Jingfeng <suijingfeng@loongson.cn> # AST2400
Link: https://patchwork.freedesktop.org/patch/msgid/20230621130032.3568-14-tzimmermann@suse.de
Thomas Zimmermann [Wed, 21 Jun 2023 12:53:46 +0000 (14:53 +0200)]
drm/ast: Detect AST 2510 model
Detect the 6th-generation AST 2510. Allows to simplify the code
for widescreen support.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com>
Tested-by: Jocelyn Falempe <jfalempe@redhat.com> # AST2600
Link: https://patchwork.freedesktop.org/patch/msgid/20230621130032.3568-13-tzimmermann@suse.de
Thomas Zimmermann [Wed, 21 Jun 2023 12:53:45 +0000 (14:53 +0200)]
drm/ast: Detect AST 1400 model
Detect the 5th-generation AST 1400. Allows to simplify the code
for widescreen support.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com>
Tested-by: Jocelyn Falempe <jfalempe@redhat.com> # AST2600
Link: https://patchwork.freedesktop.org/patch/msgid/20230621130032.3568-12-tzimmermann@suse.de
Thomas Zimmermann [Wed, 21 Jun 2023 12:53:44 +0000 (14:53 +0200)]
drm/ast: Detect AST 1300 model
Detect the 4th-generation AST 1300. Allows to simplify the code
for widescreen support.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com>
Tested-by: Jocelyn Falempe <jfalempe@redhat.com> # AST2600
Link: https://patchwork.freedesktop.org/patch/msgid/20230621130032.3568-11-tzimmermann@suse.de
Thomas Zimmermann [Wed, 21 Jun 2023 12:53:43 +0000 (14:53 +0200)]
drm/ast: Distinguish among chip generations
ASpeed distinguishes among various generations of the AST graphics
chipset with various models. [1] The most-recent model AST 2600 is
of the 7th generation, the AST 2500 is of the 6th generation, and so
on.
The ast driver simply picks one of the models as representative for
the whole generation. In several places, individual models of the
same generation need to be handled differently, which then requires
additional code for detecting the model.
Introduce different generations of the Aspeed chipset. In the source
code, refer to the generation instead of the representation model where
possible. The few places that require per-model handling are now clearly
marked.
In the enum ast_chip, we arrange each model's value such that it
encodes the generation. This allows for an easy test. The actual values
are ordered, but not of interest to the driver.
v2:
* use __ast_gen_is_eq() (Jingfeng)
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://web.archive.org/web/20141007093258/http://www.aspeedtech.com/products.php?fPath=20
Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com>
Tested-by: Jocelyn Falempe <jfalempe@redhat.com> # AST2600
Reviewed-by: Sui Jingfeng <suijingfeng@loongson.cn>
Link: https://patchwork.freedesktop.org/patch/msgid/20230621130032.3568-10-tzimmermann@suse.de
Thomas Zimmermann [Wed, 21 Jun 2023 12:53:42 +0000 (14:53 +0200)]
drm/ast: Set up release action right after enabling MMIO
Ast sets up a managed release of the MMIO access flags. Move this
code next to the MMIO access code, so that it runs if other errors
occur during the device initialization.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Tested-by: Sui Jingfeng <suijingfeng@loongson.cn> # AST2400
Reviewed-by: Sui Jingfeng <suijingfeng@loongson.cn>
Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com>
Tested-by: Jocelyn Falempe <jfalempe@redhat.com> # AST2600
Link: https://patchwork.freedesktop.org/patch/msgid/20230621130032.3568-9-tzimmermann@suse.de
Thomas Zimmermann [Wed, 21 Jun 2023 12:53:41 +0000 (14:53 +0200)]
drm/ast: Enable and unlock device access early during init
POST and memory management contains code to enable access to the
device's memory spaces. This is too late. Consolidate this code at
the beginning of the device initialization.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com>
Tested-by: Jocelyn Falempe <jfalempe@redhat.com> # AST2600
Link: https://patchwork.freedesktop.org/patch/msgid/20230621130032.3568-8-tzimmermann@suse.de
Thomas Zimmermann [Wed, 21 Jun 2023 12:53:40 +0000 (14:53 +0200)]
drm/ast: Set PCI config before accessing I/O registers
Access to I/O registers is required to detect and set up the
device. Enable the rsp PCI config bits before. While at it,
convert the magic number to macro constants.
Enabling the PCI config bits was done after trying to detect
the device. It was probably too late at this point.
v2:
* use standard 16-bit PCI r/w access (Jingfeng)
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com>
Tested-by: Jocelyn Falempe <jfalempe@redhat.com> # AST2600
Reviewed-by: Sui Jingfeng <suijingfeng@loongson.cn>
Link: https://patchwork.freedesktop.org/patch/msgid/20230621130032.3568-7-tzimmermann@suse.de
Thomas Zimmermann [Wed, 21 Jun 2023 12:53:39 +0000 (14:53 +0200)]
drm/ast: Remove device POSTing and config from chip detection
There's way too much going on in ast_detect_chip(). Move the POST
and config code from the top of the function into the caller. No
functional changes.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com>
Tested-by: Jocelyn Falempe <jfalempe@redhat.com> # AST2600
Link: https://patchwork.freedesktop.org/patch/msgid/20230621130032.3568-6-tzimmermann@suse.de
Thomas Zimmermann [Wed, 21 Jun 2023 12:53:38 +0000 (14:53 +0200)]
drm/ast: Remove dead else branch in POST code
According to the chip detection in ast_detect_chip(), AST2300 and
later always have a PCI revision of 0x20 or higher. Therefore the
code in ast_set_def_ext_reg() can not use the else branch when
selecing the EXT register values. Remove the dead branch and the
related values.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com>
Tested-by: Jocelyn Falempe <jfalempe@redhat.com> # AST2600
Link: https://patchwork.freedesktop.org/patch/msgid/20230621130032.3568-5-tzimmermann@suse.de
Thomas Zimmermann [Wed, 21 Jun 2023 12:53:37 +0000 (14:53 +0200)]
drm/ast: Implement register helpers in ast_drv.h
There are already a number of register I/O functions in ast_drv.h.
For consistency, move the remaining functions there as well. No
functional changes.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Sui Jingfeng <suijingfeng@loongson.cn>
Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com>
Tested-by: Jocelyn Falempe <jfalempe@redhat.com> # AST2600
Link: https://patchwork.freedesktop.org/patch/msgid/20230621130032.3568-4-tzimmermann@suse.de
Thomas Zimmermann [Wed, 21 Jun 2023 12:53:36 +0000 (14:53 +0200)]
drm/ast: Remove vga2_clone field
Remove the unused field vga2_clone from struct ast_device. No
functional changes.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Sui Jingfeng <suijingfeng@loongson.cn>
Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com>
Tested-by: Jocelyn Falempe <jfalempe@redhat.com> # AST2600
Link: https://patchwork.freedesktop.org/patch/msgid/20230621130032.3568-3-tzimmermann@suse.de
Thomas Zimmermann [Wed, 21 Jun 2023 12:53:35 +0000 (14:53 +0200)]
drm/ast: Fix DRAM init on AST2200
Fix the test for the AST2200 in the DRAM initialization. The value
in ast->chip has to be compared against an enum constant instead of
a numerical value.
This bug got introduced when the driver was first imported into the
kernel.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Fixes:
312fec1405dd ("drm: Initial KMS driver for AST (ASpeed Technologies) 2000 series (v2)")
Cc: Dave Airlie <airlied@redhat.com>
Cc: dri-devel@lists.freedesktop.org
Cc: <stable@vger.kernel.org> # v3.5+
Reviewed-by: Sui Jingfeng <suijingfeng@loongson.cn>
Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com>
Tested-by: Jocelyn Falempe <jfalempe@redhat.com> # AST2600
Link: https://patchwork.freedesktop.org/patch/msgid/20230621130032.3568-2-tzimmermann@suse.de
Thomas Hellström [Mon, 26 Jun 2023 09:14:48 +0000 (11:14 +0200)]
drm/ttm: Don't shadow the operation context
ttm_bo_swapout() shadows the ttm operation context which may cause
major confusion in driver callbacks when swapping out !TTM_PL_SYSTEM
memory. Fix this by reusing the operation context argument to
ttm_bo_swapout().
Cc: "Christian König" <christian.koenig@amd.com>
Cc: Roger He <Hongbo.He@amd.com>
Cc: <dri-devel@lists.freedesktop.org>
Cc: <intel-gfx@lists.freedesktop.org>
Signed-off-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Acked-by: Matthew Brost <matthew.brost@intel.com>
Reviewed-by: Christian König <ckoenig.leichtzumerken@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230626091450.14757-3-thomas.hellstrom@linux.intel.com
Thomas Zimmermann [Tue, 13 Jun 2023 11:07:13 +0000 (13:07 +0200)]
fbdev: Make support for userspace interfaces configurable
Add Kconfig option CONFIG_FB_DEVICE and make the virtual fbdev
device optional. If the new option has not been selected, fbdev
does not create files in devfs, sysfs or procfs.
Most modern Linux systems run a DRM-based graphics stack that uses
the kernel's framebuffer console, but has otherwise deprecated fbdev
support. Yet fbdev userspace interfaces are still present.
The option makes it possible to use the fbdev subsystem as console
implementation without support for userspace. This closes potential
entry points to manipulate kernel or I/O memory via framebuffers. It
also prevents the execution of driver code via ioctl or sysfs, both
of which might allow malicious software to exploit bugs in the fbdev
code.
A small number of fbdev drivers require struct fbinfo.dev to be
initialized, usually for the support of sysfs interface. Make these
drivers depend on FB_DEVICE. They can later be fixed if necessary.
v3:
* effect -> affect in Kconfig help (Daniel)
v2:
* set FB_DEVICE default to y (Geert)
* comment on {get,put}_device() (Sam)
* Kconfig fixes (Sam)
* add TODO item about FB_DEVICE dependencies (Sam)
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20230613110953.24176-39-tzimmermann@suse.de
Thomas Zimmermann [Tue, 13 Jun 2023 11:07:12 +0000 (13:07 +0200)]
fbdev/core: Rework fb init code
Init the class "graphics" before the rest of fbdev. Later steps, such
as the sysfs code, depend on the class. Also arrange the module's exit
code in reverse order.
Unexport the global variable fb_class, which is only shared internally
within the fbdev core module.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20230613110953.24176-38-tzimmermann@suse.de
Thomas Zimmermann [Tue, 13 Jun 2023 11:07:11 +0000 (13:07 +0200)]
fbdev/core: Move file-I/O code into separate file
Move fbdev's file-I/O code into a separate file and contain it in
init and cleanup helpers. No functional changes.
v3:
* add missing file fb_chrdev.c
v2:
* rename source file (Sam)
* include <linux/compat.h> (Javier, kernel test robot)
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20230613110953.24176-37-tzimmermann@suse.de
Thomas Zimmermann [Tue, 13 Jun 2023 11:07:10 +0000 (13:07 +0200)]
fbdev/core: Move procfs code to separate file
Move fbdev's procfs code into a separate file and contain it in
init and cleanup helpers. For the cleanup, replace remove_proc_entry()
with proc_remove(). It is equivalent in functionality, but looks
more like an inverse of proc_create_seq().
v2:
* document proc_remove() usage (Sam)
* revert unrelated removal of for_each_registered_fb()
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20230613110953.24176-36-tzimmermann@suse.de
Thomas Zimmermann [Tue, 13 Jun 2023 11:07:09 +0000 (13:07 +0200)]
fbdev/core: Add fb_device_{create,destroy}()
Move the logic to create and destroy fbdev devices into the new
helpers fb_device_create() and fb_device_destroy().
There was a call to fb_cleanup_device() in do_unregister_framebuffer()
that was too late. The device had already been removed at this point.
Move the call into fb_device_destroy().
Declare the helpers in the new internal header file fb_internal.h, as
they are only used within the fbdev core module.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20230613110953.24176-35-tzimmermann@suse.de
Thomas Zimmermann [Tue, 13 Jun 2023 11:07:08 +0000 (13:07 +0200)]
fbdev/core: Move framebuffer and backlight helpers into separate files
Move framebuffer and backlight helpers into separate files. Leave
fbsysfs.c to sysfs-related code. No functional changes.
The framebuffer helpers are not in fbmem.c because they are under
GPL-2.0-or-later copyright, while fbmem.c is GPL-2.0.
v2:
* include <linux/mutex.h> (Sam)
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20230613110953.24176-34-tzimmermann@suse.de
Thomas Zimmermann [Tue, 13 Jun 2023 11:07:07 +0000 (13:07 +0200)]
fbdev/core: Pass Linux device to pm_vt_switch_*() functions
Pass the Linux device to pm_vt_switch_*() instead of the virtual
fbdev device. Prepares fbdev for making struct fb_info.dev optional.
The type of device that is passed to the PM functions does not matter
much. It is only a token within the internal list of known devices.
The PM functions do not refer to any of the device's properties or its
type.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Cc: "Rafael J. Wysocki" <rafael@kernel.org>
Cc: Pavel Machek <pavel@ucw.cz>
Cc: linux-pm@vger.kernel.org
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20230613110953.24176-33-tzimmermann@suse.de
Thomas Zimmermann [Tue, 13 Jun 2023 11:07:06 +0000 (13:07 +0200)]
fbdev/tdfxfb: Set i2c adapter parent to hardware device
Use the 3dfx hardware device from the Linux device hierarchy as
parent device of the i2c adapter. Aligns the driver with the rest
of the codebase and prepares fbdev for making struct fb_info.dev
optional.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20230613110953.24176-32-tzimmermann@suse.de
Thomas Zimmermann [Tue, 13 Jun 2023 11:07:05 +0000 (13:07 +0200)]
fbdev/smscufx: Detect registered fb_info from refcount
Detect registered instances of fb_info by reading the reference
counter from struct fb_info.read. Avoids looking at the dev field
and prepares fbdev for making struct fb_info.dev optional.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Steve Glendinning <steve.glendinning@shawell.net>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230613110953.24176-31-tzimmermann@suse.de
Thomas Zimmermann [Tue, 13 Jun 2023 11:07:04 +0000 (13:07 +0200)]
fbdev/sm501fb: Output message with fb_err()
Fix case were dev_err() is being called with struct fb_info.dev.
Use fb_err() instead.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20230613110953.24176-30-tzimmermann@suse.de
Thomas Zimmermann [Tue, 13 Jun 2023 11:07:03 +0000 (13:07 +0200)]
fbdev/sh7760fb: Use hardware device with dev_() output during probe
Call output helpers in the probe function with the hardware device.
The virtual fbdev device has not been initialized at that point. Also
prepares fbdev for making struct fb_info.dev optional.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20230613110953.24176-29-tzimmermann@suse.de
Thomas Zimmermann [Tue, 13 Jun 2023 11:07:02 +0000 (13:07 +0200)]
fbdev/sh7760fb: Alloc DMA memory from hardware device
Pass the hardware device to the DMA helpers dma_alloc_coherent() and
dma_free_coherent(). The fbdev device that is currently being used is
a software device and does not provide DMA memory. Also update the
related dev_*() output statements similarly.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230613110953.24176-28-tzimmermann@suse.de
Thomas Zimmermann [Tue, 13 Jun 2023 11:07:01 +0000 (13:07 +0200)]
fbdev/sh7760fb: Output messages with fb_dbg()
Fix cases were output helpers are called with struct fb_info.dev.
Use fb_dbg() instead. Prepares fbdev for making struct fb_info.dev
optional.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20230613110953.24176-27-tzimmermann@suse.de
Thomas Zimmermann [Tue, 13 Jun 2023 11:07:00 +0000 (13:07 +0200)]
fbdev/sh7760fb: Use fb_dbg() in sh7760fb_get_color_info()
Give struct fb_info to sh7760fb_get_color_info() and use it in
call to fb_dbg(). Prepares fbdev for making struct fb_info.dev
optional.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20230613110953.24176-26-tzimmermann@suse.de
Thomas Zimmermann [Tue, 13 Jun 2023 11:06:59 +0000 (13:06 +0200)]
fbdev/rivafb: Use hardware device as backlight parent
Use the hardware device in struct fb_info.device as parent of the
backlight device. Aligns the driver with the rest of the codebase
and prepares fbdev for making struct fb_info.dev optional.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Antonino Daplas <adaplas@gmail.com>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20230613110953.24176-25-tzimmermann@suse.de
Thomas Zimmermann [Tue, 13 Jun 2023 11:06:58 +0000 (13:06 +0200)]
fbdev/rivafb: Reorder backlight and framebuffer init/cleanup
The driver's backlight code requires the framebuffer to be
registered. Therefore reorder the init and cleanup calls for
both data structures.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Antonino Daplas <adaplas@gmail.com>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20230613110953.24176-24-tzimmermann@suse.de
Thomas Zimmermann [Tue, 13 Jun 2023 11:06:57 +0000 (13:06 +0200)]
fbdev/radeonfb: Use hardware device as backlight parent
Use the hardware device in struct fb_info.device as parent of the
backlight device. Aligns the driver with the rest of the codebase
and prepares fbdev for making struct fb_info.dev optional.
v2:
* add Cc: tag (Dan)
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20230613110953.24176-23-tzimmermann@suse.de
Thomas Zimmermann [Tue, 13 Jun 2023 11:06:56 +0000 (13:06 +0200)]
fbdev/radeonfb: Reorder backlight and framebuffer cleanup
The driver's backlight code requires the framebuffer to be
registered. Therefore reorder the cleanup calls for both data
structures. The init calls are already in the correct order.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20230613110953.24176-22-tzimmermann@suse.de
Thomas Zimmermann [Tue, 13 Jun 2023 11:06:55 +0000 (13:06 +0200)]
fbdev/pxa168fb: Do not assign to struct fb_info.dev
Do not assign the hardware device to struct fb_info.dev. The
field references the fbdev software device, which is unrelated.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20230613110953.24176-21-tzimmermann@suse.de
Thomas Zimmermann [Tue, 13 Jun 2023 11:06:54 +0000 (13:06 +0200)]
fbdev/nvidiafb: Use hardware device as backlight parent
Use the hardware device in struct fb_info.device as parent of the
backlight device. Aligns the driver with the rest of the codebase
and prepares fbdev for making struct fb_info.dev optional.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Antonino Daplas <adaplas@gmail.com>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20230613110953.24176-20-tzimmermann@suse.de
Thomas Zimmermann [Tue, 13 Jun 2023 11:06:53 +0000 (13:06 +0200)]
fbdev/nvidiafb: Reorder backlight and framebuffer init/cleanup
The driver's backlight code requires the framebuffer to be
registered. Therefore reorder the init and cleanup calls for
both data structures.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Antonino Daplas <adaplas@gmail.com>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20230613110953.24176-19-tzimmermann@suse.de
Thomas Zimmermann [Tue, 13 Jun 2023 11:06:52 +0000 (13:06 +0200)]
fbdev/metronomefb: Use hardware device for dev_err()
Replace the use of the fbdev software device, stored in struct
fb_info.dev, with the hardware device from struct fb_info.device
in load_waveform(). The device is only used for printing errors
with dev_err().
This change aligns load_waveform() with the rest of the driver and
prepares fbdev for making struct fb_info.dev optional.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20230613110953.24176-18-tzimmermann@suse.de
Thomas Zimmermann [Tue, 13 Jun 2023 11:06:51 +0000 (13:06 +0200)]
fbdev/mb862xxfb: Output messages with fb_dbg()
Fix cases were output helpers are called with struct fb_info.dev.
Use fb_dbg() instead. Prepares fbdev for making struct fb_info.dev
optional.
v2:
* fix another reference to struct fb_info.dev (kernel test reobot)
* remove fb_err() from commit message
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20230613110953.24176-17-tzimmermann@suse.de
Thomas Zimmermann [Tue, 13 Jun 2023 11:06:50 +0000 (13:06 +0200)]
fbdev/fsl-diu-fb: Output messages with fb_*() helpers
Fix cases were output helpers are called with struct fb_info.dev.
Use fb_*() helpers instead. Prepares fbdev for making struct
fb_info.dev optional.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Timur Tabi <timur@kernel.org>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20230613110953.24176-16-tzimmermann@suse.de