summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/tegra/drm.h
diff options
context:
space:
mode:
authorThomas Zimmermann <tzimmermann@suse.de>2023-03-30 11:36:07 +0300
committerThierry Reding <treding@nvidia.com>2023-04-06 13:18:56 +0300
commit71ec16f45ef8d10e20c58e85f7d3644e324d3c13 (patch)
tree0c82e8068a181f57f62ae1eae52d8a302a591036 /drivers/gpu/drm/tegra/drm.h
parent25dda38e0b07941f291a442ac470b0637b7b3e60 (diff)
downloadlinux-71ec16f45ef8d10e20c58e85f7d3644e324d3c13.tar.xz
drm/tegra: 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 tegra_fbdev_setup() after tegra has registered its DRM device. As in most drivers, tegra'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 tegra. 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> Signed-off-by: Thierry Reding <treding@nvidia.com>
Diffstat (limited to 'drivers/gpu/drm/tegra/drm.h')
-rw-r--r--drivers/gpu/drm/tegra/drm.h18
1 files changed, 2 insertions, 16 deletions
diff --git a/drivers/gpu/drm/tegra/drm.h b/drivers/gpu/drm/tegra/drm.h
index 576f03b8434e..f9d18e8cf6ab 100644
--- a/drivers/gpu/drm/tegra/drm.h
+++ b/drivers/gpu/drm/tegra/drm.h
@@ -15,7 +15,6 @@
#include <drm/drm_bridge.h>
#include <drm/drm_edid.h>
#include <drm/drm_encoder.h>
-#include <drm/drm_fb_helper.h>
#include <drm/drm_fixed.h>
#include <drm/drm_probe_helper.h>
#include <uapi/drm/tegra_drm.h>
@@ -194,22 +193,9 @@ struct drm_framebuffer *tegra_fb_create(struct drm_device *drm,
const struct drm_mode_fb_cmd2 *cmd);
#ifdef CONFIG_DRM_FBDEV_EMULATION
-int tegra_drm_fb_prepare(struct drm_device *drm);
-void tegra_drm_fb_free(struct drm_device *drm);
-int tegra_drm_fb_init(struct drm_device *drm);
-void tegra_drm_fb_exit(struct drm_device *drm);
+void tegra_fbdev_setup(struct drm_device *drm);
#else
-static inline int tegra_drm_fb_prepare(struct drm_device *drm)
-{
- return 0;
-}
-static inline void tegra_drm_fb_free(struct drm_device *drm)
-{ }
-static inline int tegra_drm_fb_init(struct drm_device *drm)
-{
- return 0;
-}
-static inline void tegra_drm_fb_exit(struct drm_device *drm)
+static inline void tegra_fbdev_setup(struct drm_device *drm)
{ }
#endif