summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/armada/armada_drm.h
diff options
context:
space:
mode:
authorThomas Zimmermann <tzimmermann@suse.de>2023-03-30 09:30:46 +0200
committerThomas Zimmermann <tzimmermann@suse.de>2023-04-21 10:19:43 +0200
commit63c381552f69d188fe1e705515251c52bb07449c (patch)
treebd100d5eb4e5410f46b2f90c108b5ed549570d00 /drivers/gpu/drm/armada/armada_drm.h
parent174c3c38e3a2a37bccf56e537e3703ce020a50ff (diff)
drm/armada: Implement fbdev emulation as in-kernel client
Move code from ad-hoc fbdev callbacks into DRM client functions and remove the old callbacks. The functions instruct the client to poll for changed output or restore the display. The DRM core calls both, the old callbacks and the new client helpers, from the same places. The new functions perform the same operation as before, so there's no change in functionality. Replace all code that initializes or releases fbdev emulation throughout the driver. Instead initialize the fbdev client by a single call to armada_fbdev_setup() after armada has registered its DRM device. As in most drivers, aramda's fbdev emulation now acts like a regular DRM client. The fbdev client setup consists of the initial preparation and the hot-plugging of the display. The latter creates the fbdev device and sets up the fbdev framebuffer. The setup performs display hot-plugging once. If no display can be detected, DRM probe helpers re-run the detection on each hotplug event. A call to drm_dev_unregister() releases the client automatically. No further action is required within armada. If the fbdev framebuffer has been fully set up, struct fb_ops.fb_destroy implements the release. For partially initialized emulation, the fbdev client reverts the initial setup. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Javier Martinez Canillas <javierm@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/20230330073046.7150-5-tzimmermann@suse.de
Diffstat (limited to 'drivers/gpu/drm/armada/armada_drm.h')
-rw-r--r--drivers/gpu/drm/armada/armada_drm.h12
1 files changed, 2 insertions, 10 deletions
diff --git a/drivers/gpu/drm/armada/armada_drm.h b/drivers/gpu/drm/armada/armada_drm.h
index 1475146b1c47..c303e8c7ff6c 100644
--- a/drivers/gpu/drm/armada/armada_drm.h
+++ b/drivers/gpu/drm/armada/armada_drm.h
@@ -16,7 +16,6 @@ struct armada_crtc;
struct armada_gem_object;
struct clk;
struct drm_display_mode;
-struct drm_fb_helper;
static inline void
armada_updatel(uint32_t val, uint32_t mask, void __iomem *ptr)
@@ -55,7 +54,6 @@ extern const struct armada_variant armada510_ops;
struct armada_private {
struct drm_device drm;
- struct drm_fb_helper *fbdev;
struct armada_crtc *dcrtc[2];
struct drm_mm linear; /* protected by linear_lock */
struct mutex linear_lock;
@@ -76,15 +74,9 @@ struct armada_private {
#define drm_to_armada_dev(dev) container_of(dev, struct armada_private, drm)
#if defined(CONFIG_DRM_FBDEV_EMULATION)
-int armada_fbdev_init(struct drm_device *dev);
-void armada_fbdev_fini(struct drm_device *dev);
+void armada_fbdev_setup(struct drm_device *dev);
#else
-static inline int armada_fbdev_init(struct drm_device *dev)
-{
- return 0;
-}
-
-static inline void armada_fbdev_fini(struct drm_device *dev)
+static inline void armada_fbdev_setup(struct drm_device *dev)
{ }
#endif