Yannick Fertre
62467fccb7
drm/stm: ltdc: add support of the dynamic z-order
...
Zpos property is immutable for all hardware versions except the last
version (0x40100) which support the blending order feature
(dynamic z-order).
Signed-off-by: Yannick Fertre <[email protected] >
Signed-off-by: Philippe Cornu <[email protected] >
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2022-06-27 16:01:17 +02:00
Javier Martinez Canillas
ba497a551a
drm/stm: Use drm_module_platform_driver() to register the driver
...
The macro calls to a DRM specific platform driver init handler that checks
whether the driver is allowed to be registered or not.
Signed-off-by: Javier Martinez Canillas <[email protected] >
Acked-by: Daniel Vetter <[email protected] >
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2022-01-27 19:15:47 +01:00
Yannick Fertre
77177c934c
drm/stm: remove conflicting framebuffers
...
In case of using simplefb or another conflicting framebuffer,
call drm_aperture_remove_framebuffers() to remove memory allocated.
Signed-off-by: Yannick Fertre <[email protected] >
Reviewed-by: Thomas Zimmermann <[email protected] >
Acked-by: Philippe Cornu <[email protected] >
Signed-off-by: Philippe Cornu <[email protected] >
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2022-01-04 14:36:48 +01:00
Daniel Vetter
70a59dd829
drm/<drivers>: Constify struct drm_driver
...
Only the following drivers aren't converted:
- amdgpu, because of the driver_feature mangling due to virt support.
Subsequent patch will address this.
- nouveau, because DRIVER_ATOMIC uapi is still not the default on the
platforms where it's supported (i.e. again driver_feature mangling)
- vc4, again because of driver_feature mangling
- qxl, because the ioctl table is somewhere else and moving that is
maybe a bit too much, hence the num_ioctls assignment prevents a
const driver structure.
- arcpgu, because that is stuck behind a pending tiny-fication series
from me.
- legacy drivers, because legacy requires non-const drm_driver.
Note that for armada I also went ahead and made the ioctl array const.
Only cc'ing the driver people who've not been converted (everyone else
is way too much).
v2: Fix one misplaced const static, should be static const (0day)
v3:
- Improve commit message (Sam)
Acked-by: Sam Ravnborg <[email protected] >
Cc: kernel test robot <[email protected] >
Acked-by: Maxime Ripard <[email protected] >
Reviewed-by: Alex Deucher <[email protected] >
Signed-off-by: Daniel Vetter <[email protected] >
Cc: Sam Ravnborg <[email protected] >
Cc: Dave Airlie <[email protected] >
Cc: Gerd Hoffmann <[email protected] >
Cc: [email protected]
Cc: Harry Wentland <[email protected] >
Cc: Leo Li <[email protected] >
Cc: Alex Deucher <[email protected] >
Cc: Christian König <[email protected] >
Cc: Eric Anholt <[email protected] >
Cc: Maxime Ripard <[email protected] >
Cc: Ben Skeggs <[email protected] >
Cc: [email protected]
Signed-off-by: Daniel Vetter <[email protected] >
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-11-06 10:31:26 +01:00
Thomas Zimmermann
6f9746a5c0
drm/stm: Set GEM CMA functions with DRM_GEM_CMA_DRIVER_OPS_WITH_DUMB_CREATE
...
DRM_GEM_CMA_DRIVER_OPS_WITH_DUMB_CREATE sets the functions in
struct drm_driver to their defaults. No functional changes are
made.
v2:
* update for DRM_GEM_CMA_DRIVER_OPS_WITH_DUMB_CREATE
Signed-off-by: Thomas Zimmermann <[email protected] >
Reviewed-by: Philippe Cornu <[email protected] >
Reviewed-by: Emil Velikov <[email protected] >
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-06-10 09:05:32 +02:00
Thomas Zimmermann
c614fa22fd
drm/stm: Use GEM CMA object functions
...
Create GEM objects with drm_gem_cma_create_object_default_funcs(), which
allocates the object and sets CMA's default object functions. Corresponding
callbacks in struct drm_driver are cleared. No functional changes are made.
Driver and object-function instances use the same callback functions, with
the exception of vunmap. The implementation of vunmap is empty and left out
in CMA's default object functions.
v3:
* convert to DRIVER_OPS macro in a separate patch
Signed-off-by: Thomas Zimmermann <[email protected] >
Reviewed-by: Philippe Cornu <[email protected] >
Reviewed-by: Emil Velikov <[email protected] >
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-06-10 09:05:25 +02:00
Daniel Vetter
967be0ffa6
drm/stm: Drop explicit drm_mode_config_cleanup call
...
It's right above the drm_dev_put().
This is made possible by a preceeding patch which added a drmm_
cleanup action to drm_mode_config_init(), hence all we need to do to
ensure that drm_mode_config_cleanup() is run on final drm_device
cleanup is check the new error code for _init().
Aside: Another driver with a bit much devm_kzalloc, which should
probably use drmm_kzalloc instead ...
v2: Explain why this cleanup is possible (Laurent).
v3: Use drmm_mode_config_init() for more clarity (Sam, Thomas)
Cc: Sam Ravnborg <[email protected] >
Cc: Thomas Zimmermann <[email protected] >
Acked-by: Sam Ravnborg <[email protected] >
Acked-by: Philippe Cornu <[email protected] >
Cc: Laurent Pinchart <[email protected] >
Signed-off-by: Daniel Vetter <[email protected] >
Cc: Yannick Fertre <[email protected] >
Cc: Philippe Cornu <[email protected] >
Cc: Benjamin Gaignard <[email protected] >
Cc: Vincent Abriou <[email protected] >
Cc: Maxime Coquelin <[email protected] >
Cc: Alexandre Torgue <[email protected] >
Cc: [email protected]
Cc: [email protected]
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-03-26 16:06:00 +01:00
Thomas Zimmermann
9661510e51
drm/stm: Convert to CRTC VBLANK callbacks
...
VBLANK callbacks in struct drm_driver are deprecated in favor of
their equivalents in struct drm_crtc_funcs. Convert stm over.
Signed-off-by: Thomas Zimmermann <[email protected] >
Tested-by: Yannick Fertré <[email protected] >
Acked-by: Philippe Cornu <[email protected] >
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-02-13 13:10:09 +01:00
Thomas Zimmermann
b70fbfc7d5
drm/stm: Convert to struct drm_crtc_helper_funcs.get_scanout_position()
...
The callback struct drm_driver.get_scanout_position() is deprecated in
favor of struct drm_crtc_helper_funcs.get_scanout_position(). Convert stm
over.
Signed-off-by: Thomas Zimmermann <[email protected] >
Acked-by: Philippe Cornu <[email protected] >
Tested-by: Yannick Fertré <[email protected] >
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-02-13 13:09:22 +01:00
Daniel Vetter
b8764eaf8a
drm/stm: Drop drm_gem_prime_export/import
...
They're the default.
Aside: Would be really nice to switch the others over to
drm_gem_object_funcs.
Acked-by: Philippe Cornu <[email protected] >
Reviewed-by: Eric Anholt <[email protected] >
Reviewed-by: Emil Velikov <[email protected] >
Signed-off-by: Daniel Vetter <[email protected] >
Cc: Yannick Fertre <[email protected] >
Cc: Philippe Cornu <[email protected] >
Cc: Benjamin Gaignard <[email protected] >
Cc: Vincent Abriou <[email protected] >
Cc: Maxime Coquelin <[email protected] >
Cc: Alexandre Torgue <[email protected] >
Cc: [email protected]
Cc: [email protected]
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2019-06-21 20:10:10 +02:00
Daniel Vetter
0424fdaf88
drm/prime: Actually remove DRIVER_PRIME everywhere
...
Split out to make the functional changes stick out more.
All places where DRIVER_PRIME was used have been removed in previous
patches already.
v2: amdgpu gained DRIVER_SYNCOBJ_TIMELINE.
v3: amdgpu lost DRIVER_SYNCOBJ_TIMELINE.
v4: Don't add a space in i915_drv.c (Sam)
v5: Add note that previous patches removed all the DRIVER_PRIME users
already (Emil).
v6: Fixupe ingenic (new driver) while applying.
Cc: Sam Ravnborg <[email protected] >
Reviewed-by: Emil Velikov <[email protected] >
Reviewed-by: Eric Anholt <[email protected] >
Signed-off-by: Daniel Vetter <[email protected] >
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: NXP Linux Team <[email protected] >
Cc: [email protected]
Cc: [email protected]
Cc: VMware Graphics <[email protected] >
Cc: [email protected]
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2019-06-21 17:30:32 +02:00
Yannick Fertré
2b5d74fa3c
drm/stm: drv: fix suspend/resume
...
Without this fix, the system can not go in "suspend" mode
due to an error in drv_suspend function.
Fixes: 35ab6cfbf2 ("drm/stm: support runtime power management")
Signed-off-by: Yannick Fertré <[email protected] >
Acked-by: Philippe Cornu <[email protected] >
Signed-off-by: Benjamin Gaignard <[email protected] >
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2019-06-20 17:03:24 +02:00
Yannick Fertré
35ab6cfbf2
drm/stm: support runtime power management
...
This patch enables runtime power management (runtime PM) support for
the display controller. pm_runtime_enable() and pm_runtime_disable()
are added during ltdc load and unload respectively.
pm_runtime_get_sync() and pm_runtime_put_sync() are added for ltdc
register access.
Signed-off-by: Yannick Fertré <[email protected] >
Acked-by: Philippe Cornu <[email protected] >
Signed-off-by: Benjamin Gaignard <[email protected] >
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2019-06-07 14:45:22 +02:00
Yannick Fertré
df61c77665
drm/stm: add sleep power management
...
Implements system sleep power management ops.
Signed-off-by: Yannick Fertré <[email protected] >
Acked-by: Philippe Cornu <[email protected] >
Signed-off-by: Benjamin Gaignard <[email protected] >
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2019-04-01 11:00:18 +02:00
Daniel Vetter
fcd70cd36b
drm: Split out drm_probe_helper.h
...
Having the probe helper stuff (which pretty much everyone needs) in
the drm_crtc_helper.h file (which atomic drivers should never need) is
confusing. Split them out.
To make sure I actually achieved the goal here I went through all
drivers. And indeed, all atomic drivers are now free of
drm_crtc_helper.h includes.
v2: Make it compile. There was so much compile fail on arm drivers
that I figured I'll better not include any of the acks on v1.
v3: Massive rebase because i915 has lost a lot of drmP.h includes, but
not all: Through drm_crtc_helper.h > drm_modeset_helper.h -> drmP.h
there was still one, which this patch largely removes. Which means
rolling out lots more includes all over.
This will also conflict with ongoing drmP.h cleanup by others I
expect.
v3: Rebase on top of atomic bochs.
v4: Review from Laurent for bridge/rcar/omap/shmob/core bits:
- (re)move some of the added includes, use the better include files in
other places (all suggested from Laurent adopted unchanged).
- sort alphabetically
v5: Actually try to sort them, and while at it, sort all the ones I
touch.
v6: Rebase onto i915 changes.
v7: Rebase once more.
Acked-by: Harry Wentland <[email protected] >
Acked-by: Sam Ravnborg <[email protected] >
Cc: Sam Ravnborg <[email protected] >
Cc: Jani Nikula <[email protected] >
Cc: Laurent Pinchart <[email protected] >
Acked-by: Rodrigo Vivi <[email protected] >
Acked-by: Benjamin Gaignard <[email protected] >
Acked-by: Jani Nikula <[email protected] >
Acked-by: Neil Armstrong <[email protected] >
Acked-by: Oleksandr Andrushchenko <[email protected] >
Acked-by: CK Hu <[email protected] >
Acked-by: Alex Deucher <[email protected] >
Acked-by: Sam Ravnborg <[email protected] >
Reviewed-by: Laurent Pinchart <[email protected] >
Acked-by: Liviu Dudau <[email protected] >
Signed-off-by: Daniel Vetter <[email protected] >
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2019-01-24 13:20:42 +01:00
Sam Ravnborg
2a6b4990b1
drm/stm: prepare for drmP.h removal from drm_modeset_helper.h
...
The use of drmP.h is discouraged and removal of it from
drm_modeset_helper.h caused drm/stm to fail to build.
This patch introduce the necessary fixes to prepare for the
drmP.h removal from drm_modeset_helper.h.
Build tested on arm and x86 allmodconfig
v2:
- sort list of include files
Signed-off-by: Sam Ravnborg <[email protected] >
Acked-by: Benjamin Gaignard <[email protected] >
Cc: Yannick Fertre <[email protected] >
Cc: Philippe Cornu <[email protected] >
Cc: Vincent Abriou <[email protected] >
Cc: David Airlie <[email protected] >
Cc: Daniel Vetter <[email protected] >
Signed-off-by: Daniel Vetter <[email protected] >
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2019-01-24 13:06:35 +01:00
Noralf Trønnes
e0ce0e2a5d
drm/stm: Use drm_fbdev_generic_setup()
...
The CMA helper is already using the drm_fb_helper_generic_probe part of
the generic fbdev emulation. This patch makes full use of the generic
fbdev emulation by using its drm_client callbacks. This means that
drm_mode_config_funcs->output_poll_changed and drm_driver->lastclose are
now handled by the emulation code. Additionally fbdev unregister happens
automatically on drm_dev_unregister().
The drm_fbdev_generic_setup() call is put after drm_dev_register() in the
driver. This is done to highlight the fact that fbdev emulation is an
internal client that makes use of the driver, it is not part of the
driver as such. If fbdev setup fails, an error is printed, but the driver
succeeds probing.
drm_fbdev_generic_setup() handles mode_config.num_connector being zero.
In that case it retries fbdev setup on the next .output_poll_changed.
Cc: Yannick Fertre <[email protected] >
Cc: Philippe Cornu <[email protected] >
Cc: Benjamin Gaignard <[email protected] >
Cc: Vincent Abriou <[email protected] >
Signed-off-by: Noralf Trønnes <[email protected] >
Acked-by: Yannick Fertré <[email protected] >
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2018-10-25 17:00:28 +02:00
Benjamin Gaignard
53273b5222
drm: stm: implement get_scanout_position function
...
Hardware allow to read the position in scanout buffer so
we can use this information to make wait of vblank more accurate.
Active area bounds (start, end, total height) have already been
computed and written in ltdc registers, read them and get the
current line position to compute vpos value.
Signed-off-by: Benjamin Gaignard <[email protected] >
Reviewed-by: Yannick Fertré <[email protected] >
Tested-by: Yannick Fertré <[email protected] >
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2018-09-27 15:04:26 +02:00
Thomas Zimmermann
a1a6fa3dcd
drm/stm: Replace drm_dev_unref with drm_dev_put
...
This patch unifies the naming of DRM functions for reference counting
of struct drm_device. The resulting code is more aligned with the rest
of the Linux kernel interfaces.
Signed-off-by: Thomas Zimmermann <[email protected] >
Acked-by: Philippe Cornu <[email protected] >
Signed-off-by: Benjamin Gaignard <[email protected] >
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2018-07-13 10:11:02 +02:00
Philippe CORNU
c8da819478
drm/stm: move enable/disable_vblank to crtc
...
enable/disable_vblank() functions at drm_driver level
are deprecated. Move them to the ltdc drm_crtc_funcs
structure.
Signed-off-by: Philippe Cornu <[email protected] >
Reviewed-by: Vincent Abriou <[email protected] >
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2018-04-19 12:03:11 +02:00
Benjamin Gaignard
879659bb87
drm/stm: check pitch and size calculations even if !CONFIG_MMU
...
In all cases we have to check pitch and size calculations to speed up
data transfer.
Fixes: 21f815bf77 ("drm/stm: drv: Improve data transfers")
Signed-off-by: Benjamin Gaignard <[email protected] >
Tested-by: Philippe Cornu <[email protected] >
Reviewed-by: Philippe Cornu <[email protected] >
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2018-02-23 09:37:12 +01:00
Philippe Cornu
21f815bf77
drm/stm: drv: Improve data transfers
...
To optimize data transfers, align pitch on 128 bytes & height
on 4 bytes. This optimization is not applicable on hw without MMU.
Signed-off-by: Yannick Fertre <[email protected] >
Signed-off-by: Vincent Abriou <[email protected] >
Signed-off-by: Philippe Cornu <[email protected] >
Signed-off-by: Benjamin Gaignard <[email protected] >
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2018-01-30 11:45:15 +01:00
Noralf Trønnes
068b393c1a
drm/stm: Use drm_fb_cma_fbdev_init/fini()
...
Use drm_fb_cma_fbdev_init() and drm_fb_cma_fbdev_fini() which relies on
the fact that drm_device holds a pointer to the drm_fb_helper structure.
This means that the driver doesn't have to keep track of that.
Also use the drm_fb_helper functions directly.
Remove duplicate ldev assignment.
Cc: Yannick Fertre <[email protected] >
Cc: Philippe Cornu <[email protected] >
Cc: Benjamin Gaignard <[email protected] >
Cc: Vincent Abriou <[email protected] >
Signed-off-by: Noralf Trønnes <[email protected] >
Acked-by: Philippe Cornu <[email protected] >
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2017-12-08 14:47:41 +01:00
Benjamin Gaignard
ec17f0341d
gpu: drm: stm: Adopt SPDX identifiers
...
Add SPDX identifiers to files under stm directory
Signed-off-by: Benjamin Gaignard <[email protected] >
Acked-by: Vincent Abriou <[email protected] >
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2017-12-06 15:51:37 +01:00
Noralf Trønnes
4930a4334e
drm/stm: Use drm_gem_fb_create()
...
drm_fb_cma_create() is just a wrapper around drm_gem_fb_create() now,
so use the function directly.
Cc: Yannick Fertre <[email protected] >
Cc: Philippe Cornu <[email protected] >
Cc: Benjamin Gaignard <[email protected] >
Cc: Vincent Abriou <[email protected] >
Signed-off-by: Noralf Trønnes <[email protected] >
Acked-by: Philippe Cornu <[email protected] >
Tested-by: Philippe Cornu <[email protected] >
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2017-09-02 14:23:27 +02:00
Noralf Trønnes
58ba9aabb8
drm/stm: Use .dumb_map_offset and .dumb_destroy defaults
...
This driver can use the drm_driver.dumb_destroy and
drm_driver.dumb_map_offset defaults, so no need to set them.
Cc: Yannick Fertre <[email protected] >
Cc: Philippe Cornu <[email protected] >
Cc: Benjamin Gaignard <[email protected] >
Cc: Vincent Abriou <[email protected] >
Signed-off-by: Noralf Trønnes <[email protected] >
Tested-by: Philippe Cornu <[email protected] >
Acked-by: Philippe Cornu <[email protected] >
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2017-07-29 13:57:51 +02:00
Philippe CORNU
af5125de7a
drm/stm: drv: Rename platform driver name
...
Rename the platform driver name from "stm" to "stm32-display"
for a better readability in /sys/bus/platform/drivers entries.
Note: We keep "stm" as drm_driver.name because it is better
when using "modetest -M stm ..." (even if recent modetest patch
avoids using -M).
Signed-off-by: Philippe CORNU <[email protected] >
Reviewed-by: Benjamin Gaignard <[email protected] >
Signed-off-by: Benjamin Gaignard <[email protected] >
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2017-07-26 15:01:24 +02:00
Yannick Fertre
b759012c5f
drm/stm: Add STM32 LTDC driver
...
This controller provides output signals to interface directly a variety
of LCD and TFT panels. These output signals are: RGB signals
(up to 24bpp), vertical & horizontal synchronisations, data enable and
the pixel clock.
Reviewed-by: Eric Anholt <[email protected] >
Signed-off-by: Yannick Fertre <[email protected] >
Signed-off-by: Eric Anholt <[email protected] >
Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
Reviewed-by: Neil Armstrong <[email protected] >
Reviewed-by: Eric Anholt <[email protected] >
2017-04-14 11:30:29 -07:00