aboutsummaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/stm/drv.c
AgeCommit message (Collapse)AuthorFilesLines
2020-11-06drm/<drivers>: Constify struct drm_driverDaniel Vetter1-1/+1
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-06-10drm/stm: Set GEM CMA functions with DRM_GEM_CMA_DRIVER_OPS_WITH_DUMB_CREATEThomas Zimmermann1-6/+1
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-10drm/stm: Use GEM CMA object functionsThomas Zimmermann1-5/+1
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-03-26drm/stm: Drop explicit drm_mode_config_cleanup callDaniel Vetter1-6/+4
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-02-13drm/stm: Convert to CRTC VBLANK callbacksThomas Zimmermann1-1/+0
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-13drm/stm: Convert to struct drm_crtc_helper_funcs.get_scanout_position()Thomas Zimmermann1-1/+0
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]
2019-06-21drm/stm: Drop drm_gem_prime_export/importDaniel Vetter1-2/+0
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-21drm/prime: Actually remove DRIVER_PRIME everywhereDaniel Vetter1-2/+1
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-20drm/stm: drv: fix suspend/resumeYannick Fertré1-7/+8
Without this fix, the system can not go in "suspend" mode due to an error in drv_suspend function. Fixes: 35ab6cfbf211 ("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-07drm/stm: support runtime power managementYannick Fertré1-8/+35
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-04-01drm/stm: add sleep power managementYannick Fertré1-0/+35
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-01-24drm: Split out drm_probe_helper.hDaniel Vetter1-1/+1
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-24drm/stm: prepare for drmP.h removal from drm_modeset_helper.hSam Ravnborg1-1/+5
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]
2018-10-25drm/stm: Use drm_fbdev_generic_setup()Noralf Trønnes1-9/+2
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-09-27drm: stm: implement get_scanout_position functionBenjamin Gaignard1-0/+2
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-07-13drm/stm: Replace drm_dev_unref with drm_dev_putThomas Zimmermann1-5/+5
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-04-19drm/stm: move enable/disable_vblank to crtcPhilippe CORNU1-2/+0
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-02-23drm/stm: check pitch and size calculations even if !CONFIG_MMUBenjamin Gaignard1-2/+0
In all cases we have to check pitch and size calculations to speed up data transfer. Fixes: 21f815bf773c ("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-01-30drm/stm: drv: Improve data transfersPhilippe Cornu1-1/+19
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]
2017-12-08drm/stm: Use drm_fb_cma_fbdev_init/fini()Noralf Trønnes1-32/+6
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-06gpu: drm: stm: Adopt SPDX identifiersBenjamin Gaignard1-2/+1
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-09-02drm/stm: Use drm_gem_fb_create()Noralf Trønnes1-1/+2
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-07-29drm/stm: Use .dumb_map_offset and .dumb_destroy defaultsNoralf Trønnes1-2/+0
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-26drm/stm: drv: Rename platform driver namePhilippe CORNU1-14/+7
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-04-14drm/stm: Add STM32 LTDC driverYannick Fertre1-0/+221
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]>