linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/11] drm,fbdev: Move video= option to drivers/video
@ 2023-02-09 13:54 Thomas Zimmermann
  2023-02-09 13:54 ` [PATCH 01/11] fbdev: Fix contact info in fb_cmdline.c Thomas Zimmermann
                   ` (10 more replies)
  0 siblings, 11 replies; 28+ messages in thread
From: Thomas Zimmermann @ 2023-02-09 13:54 UTC (permalink / raw)
  To: daniel, airlied, deller, javierm, maarten.lankhorst, mripard,
	geoff, mpe, npiggin, christophe.leroy
  Cc: linux-fbdev, linuxppc-dev, Thomas Zimmermann, dri-devel

The kernel's video= option sets the initial video mode. It is shared
by fbdev and DRM, but located within the fbdev code. Move it to
drivers/video/ and adapt callers. Allows DRM (and others) to use the
option without depending on fbdev.

While at it, fix the interface of the lookup functions. This requires
a number of changes. First clarify the ownership of the option string
in patch 2. The helper fb_get_options() returns the video= parameter's
value. It's sometimes a copy and sometimes the original string. Hence
callers, mostly fbdev drivers, have just leaked the returned string.
Change this to always duplicate the option string in fb_get_options()
and transfer ownership of the copy to the caller. We can then start to
fix the memory leaks in the fbdev drivers.

There's a global video= setting and a number of per-output settings.
In patches 3 to 5, support explicit lookup of the global video option
and lookup the string in fbdev's modedb and in a PS3 driver. Then
avoid exporting the global setting's internal state variable in patch 6.

Finally, in patches 7 to 11, move the video= option to drivers/video.
It can be used directly in DRM and a PS3 driver. This fixes any memory
leaks from the returned option string. For fbdev drivers, the helper
fb_get_options() remains as an adapter aroudn the new interface.

Tested with DRM and fbdev and built for the PS3.

Thomas Zimmermann (11):
  fbdev: Fix contact info in fb_cmdline.c
  fbdev: Transfer video= option strings to caller; clarify ownership
  fbdev: Support NULL for name in option-string lookup
  drivers/ps3: Read video= option with fb_get_option()
  fbdev: Read video= option with fb_get_option() in modedb
  fbdev: Unexport fb_mode_option
  fbdev: Move option-string lookup into helper
  fbdev: Handle video= parameter in video/cmdline.c
  driver/ps3: Include <video/cmdline.h> for mode parsing
  drm: Include <video/cmdline.h> for mode parsing
  drm: Fix comment on mode parsing

 drivers/gpu/drm/Kconfig               |   2 +-
 drivers/gpu/drm/drm_connector.c       |   9 +-
 drivers/gpu/drm/drm_modes.c           |   3 +-
 drivers/ps3/ps3av.c                   |   9 +-
 drivers/video/Kconfig                 |   3 +
 drivers/video/Makefile                |   1 +
 drivers/video/cmdline.c               | 133 ++++++++++++++++++++++++++
 drivers/video/fbdev/Kconfig           |   5 +-
 drivers/video/fbdev/core/Makefile     |   3 +-
 drivers/video/fbdev/core/fb_cmdline.c |  94 +++++-------------
 drivers/video/fbdev/core/modedb.c     |   8 +-
 include/linux/fb.h                    |   1 -
 include/video/cmdline.h               |  20 ++++
 13 files changed, 202 insertions(+), 89 deletions(-)
 create mode 100644 drivers/video/cmdline.c
 create mode 100644 include/video/cmdline.h


base-commit: 1a019dd7a5d25f7c1c9b77931138290e28947e6a
-- 
2.39.1


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

end of thread, other threads:[~2023-02-17 11:24 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-09 13:54 [PATCH 00/11] drm,fbdev: Move video= option to drivers/video Thomas Zimmermann
2023-02-09 13:54 ` [PATCH 01/11] fbdev: Fix contact info in fb_cmdline.c Thomas Zimmermann
2023-02-17  8:17   ` Javier Martinez Canillas
2023-02-09 13:55 ` [PATCH 02/11] fbdev: Transfer video= option strings to caller; clarify ownership Thomas Zimmermann
2023-02-17  8:37   ` Javier Martinez Canillas
2023-02-17  9:44     ` Thomas Zimmermann
2023-02-17 11:23       ` Javier Martinez Canillas
2023-02-09 13:55 ` [PATCH 03/11] fbdev: Support NULL for name in option-string lookup Thomas Zimmermann
2023-02-17  8:45   ` Javier Martinez Canillas
2023-02-09 13:55 ` [PATCH 04/11] drivers/ps3: Read video= option with fb_get_option() Thomas Zimmermann
2023-02-12 16:53   ` Geoff Levand
2023-02-13 11:29     ` Thomas Zimmermann
2023-02-13 16:31       ` Geoff Levand
2023-02-17  8:46   ` Javier Martinez Canillas
2023-02-09 13:55 ` [PATCH 05/11] fbdev: Read video= option with fb_get_option() in modedb Thomas Zimmermann
2023-02-17  8:47   ` Javier Martinez Canillas
2023-02-09 13:55 ` [PATCH 06/11] fbdev: Unexport fb_mode_option Thomas Zimmermann
2023-02-17  8:48   ` Javier Martinez Canillas
2023-02-09 13:55 ` [PATCH 07/11] fbdev: Move option-string lookup into helper Thomas Zimmermann
2023-02-17  8:49   ` Javier Martinez Canillas
2023-02-09 13:55 ` [PATCH 08/11] fbdev: Handle video= parameter in video/cmdline.c Thomas Zimmermann
2023-02-17  9:00   ` Javier Martinez Canillas
2023-02-09 13:55 ` [PATCH 09/11] driver/ps3: Include <video/cmdline.h> for mode parsing Thomas Zimmermann
2023-02-17  9:01   ` Javier Martinez Canillas
2023-02-09 13:55 ` [PATCH 10/11] drm: " Thomas Zimmermann
2023-02-17  9:03   ` Javier Martinez Canillas
2023-02-09 13:55 ` [PATCH 11/11] drm: Fix comment on " Thomas Zimmermann
2023-02-17  9:04   ` Javier Martinez Canillas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).