All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 01/21] drm/fb-helper: Add fill_info() functions
@ 2019-03-26 13:19 Daniel Vetter
  2019-03-26 13:19 ` [PATCH 02/21] drm/fb-helper: set fbi->fix.id in fill_info() Daniel Vetter
                   ` (23 more replies)
  0 siblings, 24 replies; 58+ messages in thread
From: Daniel Vetter @ 2019-03-26 13:19 UTC (permalink / raw)
  To: DRI Development; +Cc: Daniel Vetter, Intel Graphics Development, Daniel Vetter

The fbdev split between fix and var information is kinda
pointless for drm drivers since everything is fixed: The fbdev
emulation doesn't support changing modes at all.

Create a new simplified helper and use it in the generic fbdev
helper code. Follow-up patches will beef it up more and roll
it out to all drivers.

v2: We need to keep sizes, since they might not match the fb dimesions
(Noralf)

Cc: Noralf Trønnes <noralf@tronnes.org>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
---
 drivers/gpu/drm/drm_fb_helper.c | 30 ++++++++++++++++++++++++++++--
 include/drm/drm_fb_helper.h     |  3 +++
 2 files changed, 31 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
index c3d6a8c78a51..b89d177228e2 100644
--- a/drivers/gpu/drm/drm_fb_helper.c
+++ b/drivers/gpu/drm/drm_fb_helper.c
@@ -2105,6 +2105,33 @@ void drm_fb_helper_fill_var(struct fb_info *info, struct drm_fb_helper *fb_helpe
 }
 EXPORT_SYMBOL(drm_fb_helper_fill_var);
 
+/**
+ * drm_fb_helper_fill_info - initializes fbdev information
+ * @info: fbdev instance to set up
+ * @fb_helper: fb helper instance to use as template
+ * @sizes: describes fbdev size and scanout surface size
+ *
+ *
+ * Sets up the variable and fixed fbdev metainformation from the given fb helper
+ * instance and the drm framebuffer allocated in &drm_fb_helper.fb.
+ *
+ * Drivers should call this (or their equivalent setup code) from their
+ * &drm_fb_helper_funcs.fb_probe callback after having allocated the fbdev
+ * backing storage framebuffer.
+ */
+void drm_fb_helper_fill_info(struct fb_info *info,
+			     struct drm_fb_helper *fb_helper,
+			     struct drm_fb_helper_surface_size *sizes)
+{
+	struct drm_framebuffer *fb = fb_helper->fb;
+
+	drm_fb_helper_fill_fix(info, fb->pitches[0], fb->format->depth);
+	drm_fb_helper_fill_var(info, fb_helper,
+			       sizes->fb_width, sizes->fb_height);
+
+}
+EXPORT_SYMBOL(drm_fb_helper_fill_info);
+
 static int drm_fb_helper_probe_connector_modes(struct drm_fb_helper *fb_helper,
 						uint32_t maxX,
 						uint32_t maxY)
@@ -3165,8 +3192,7 @@ int drm_fb_helper_generic_probe(struct drm_fb_helper *fb_helper,
 #endif
 	strcpy(fbi->fix.id, "DRM emulated");
 
-	drm_fb_helper_fill_fix(fbi, fb->pitches[0], fb->format->depth);
-	drm_fb_helper_fill_var(fbi, fb_helper, sizes->fb_width, sizes->fb_height);
+	drm_fb_helper_fill_info(fbi, fb_helper, sizes);
 
 	if (fb->funcs->dirty) {
 		struct fb_ops *fbops;
diff --git a/include/drm/drm_fb_helper.h b/include/drm/drm_fb_helper.h
index 286d58efed5d..9ef72f20662d 100644
--- a/include/drm/drm_fb_helper.h
+++ b/include/drm/drm_fb_helper.h
@@ -293,6 +293,9 @@ void drm_fb_helper_fill_var(struct fb_info *info, struct drm_fb_helper *fb_helpe
 			    uint32_t fb_width, uint32_t fb_height);
 void drm_fb_helper_fill_fix(struct fb_info *info, uint32_t pitch,
 			    uint32_t depth);
+void drm_fb_helper_fill_info(struct fb_info *info,
+			     struct drm_fb_helper *fb_helper,
+			     struct drm_fb_helper_surface_size *sizes);
 
 void drm_fb_helper_unlink_fbi(struct drm_fb_helper *fb_helper);
 
-- 
2.20.1

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 58+ messages in thread

end of thread, other threads:[~2019-03-27 22:58 UTC | newest]

Thread overview: 58+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-26 13:19 [PATCH 01/21] drm/fb-helper: Add fill_info() functions Daniel Vetter
2019-03-26 13:19 ` [PATCH 02/21] drm/fb-helper: set fbi->fix.id in fill_info() Daniel Vetter
2019-03-26 13:56   ` Noralf Trønnes
2019-03-26 13:19 ` [PATCH 03/21] drm/fb_helper: set info->par " Daniel Vetter
2019-03-26 13:57   ` Noralf Trønnes
2019-03-26 13:19 ` [PATCH 04/21] drm/amdgpu: Use drm_fb_helper_fill_info Daniel Vetter
2019-03-26 14:04   ` Noralf Trønnes
2019-03-26 13:19 ` [PATCH 05/21] drm/armada: " Daniel Vetter
2019-03-26 14:06   ` Noralf Trønnes
2019-03-26 13:19 ` [PATCH 06/21] drm/ast: " Daniel Vetter
2019-03-26 14:21   ` Noralf Trønnes
2019-03-26 13:19 ` [PATCH 07/21] drm/cirrus: " Daniel Vetter
2019-03-26 14:24   ` Noralf Trønnes
2019-03-26 13:19 ` [PATCH 08/21] drm/exynos: " Daniel Vetter
2019-03-26 13:19   ` Daniel Vetter
2019-03-26 14:27   ` Noralf Trønnes
2019-03-26 14:27     ` Noralf Trønnes
2019-03-27 22:57   ` Inki Dae
2019-03-27 22:57     ` Inki Dae
2019-03-26 13:19 ` [PATCH 09/21] drm/gma500: " Daniel Vetter
2019-03-26 14:31   ` Noralf Trønnes
2019-03-26 13:19 ` [PATCH 10/21] drm/hibmc: " Daniel Vetter
2019-03-26 14:32   ` Noralf Trønnes
2019-03-26 13:19 ` [PATCH 11/21] drm/i915: " Daniel Vetter
2019-03-26 14:34   ` Noralf Trønnes
2019-03-27 11:10   ` Joonas Lahtinen
2019-03-27 11:15     ` Daniel Vetter
2019-03-26 13:19 ` [PATCH 12/21] drm/mga200g: " Daniel Vetter
2019-03-26 14:41   ` Noralf Trønnes
2019-03-26 13:20 ` [PATCH 14/21] drm/nouveau: " Daniel Vetter
2019-03-26 14:47   ` Noralf Trønnes
2019-03-26 13:20 ` [PATCH 15/21] drm/omap: " Daniel Vetter
2019-03-26 14:49   ` Noralf Trønnes
     [not found] ` <20190326132008.11781-1-daniel.vetter-/w4YWyX8dFk@public.gmane.org>
2019-03-26 13:20   ` [PATCH 13/21] drm/bochs: " Daniel Vetter
2019-03-26 14:42     ` Noralf Trønnes
2019-03-26 14:45       ` Noralf Trønnes
2019-03-26 13:20   ` [PATCH 16/21] drm/radeon: " Daniel Vetter
2019-03-26 14:51     ` Noralf Trønnes
2019-03-26 13:20 ` [PATCH 17/21] drm/rockchip: " Daniel Vetter
2019-03-26 13:20   ` Daniel Vetter
2019-03-26 14:52   ` Noralf Trønnes
2019-03-26 14:52     ` Noralf Trønnes
2019-03-26 13:20 ` [PATCH 18/21] drm/tegra: " Daniel Vetter
2019-03-26 14:53   ` Noralf Trønnes
2019-03-26 14:55   ` Thierry Reding
2019-03-26 13:20 ` [PATCH 19/21] drm/udl: " Daniel Vetter
2019-03-26 14:58   ` Noralf Trønnes
2019-03-26 13:20 ` [PATCH 20/21] drm/vboxvideo: " Daniel Vetter
2019-03-26 14:59   ` Noralf Trønnes
2019-03-26 13:20 ` [PATCH 21/21] drm/fb-helper: Unexport fill_{var,info} Daniel Vetter
2019-03-26 14:34   ` Alex Deucher
2019-03-26 15:01   ` [PATCH 21/21] drm/fb-helper: Unexport fill_{var, info} Noralf Trønnes
2019-03-27  9:13     ` Daniel Vetter
2019-03-26 13:50 ` [PATCH 01/21] drm/fb-helper: Add fill_info() functions Noralf Trønnes
2019-03-26 17:40 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [01/21] " Patchwork
2019-03-26 17:46 ` ✗ Fi.CI.SPARSE: " Patchwork
2019-03-26 18:19 ` ✓ Fi.CI.BAT: success " Patchwork
2019-03-27  1:57 ` ✓ Fi.CI.IGT: " Patchwork

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.