drm/fb-helper: Move modesetting code to drm_client

Submitted by Noralf Trønnes on March 26, 2019, 5:55 p.m.

Details

Reviewer None
Submitted March 26, 2019, 5:55 p.m.
Last Updated June 8, 2019, 3:27 p.m.
Revision 8

Cover Letter(s)

Revision 1
      This moves the modesetting code from drm_fb_helper to drm_client so it
can be shared by all internal clients.

I have also added a client display abstraction and a bootsplash example
client to show where this might be heading. Hopefully Max Staudt will be
able to pick up his bootsplash work now.

Noralf.

Noralf Trønnes (16):
  drm/fb-helper: Remove unused gamma_size variable
  drm/fb-helper: dpms_legacy(): Only set on connectors in use
  drm/atomic: Move __drm_atomic_helper_disable_plane/set_config()
  drm/fb-helper: No need to cache rotation and sw_rotations
  drm/fb-helper: Remove drm_fb_helper_crtc->{x,y,desired_mode}
  drm/i915/fbdev: Move intel_fb_initial_config() to fbdev helper
  drm/fb-helper: Remove drm_fb_helper_crtc
  drm/fb-helper: Prepare to move out commit code
  drm/fb-helper: Move out commit code
  drm/fb-helper: Remove drm_fb_helper_connector
  drm/fb-helper: Prepare to move out modeset config code
  drm/fb-helper: Move out modeset config code
  drm/fb-helper: Avoid race with DRM userspace
  drm/client: Add display abstraction
  drm/client: Hack: Add bootsplash example
  drm/vc4: Call drm_dev_register() after all setup is done

 Documentation/gpu/todo.rst          |   10 +
 drivers/gpu/drm/Kconfig             |    5 +
 drivers/gpu/drm/Makefile            |    1 +
 drivers/gpu/drm/drm_atomic.c        |  168 ++++
 drivers/gpu/drm/drm_atomic_helper.c |  164 ---
 drivers/gpu/drm/drm_auth.c          |   20 +
 drivers/gpu/drm/drm_bootsplash.c    |  216 ++++
 drivers/gpu/drm/drm_client.c        | 1449 +++++++++++++++++++++++++++
 drivers/gpu/drm/drm_crtc_internal.h |    5 +
 drivers/gpu/drm/drm_drv.c           |    4 +
 drivers/gpu/drm/drm_fb_helper.c     | 1151 ++-------------------
 drivers/gpu/drm/drm_internal.h      |    2 +
 drivers/gpu/drm/i915/intel_fbdev.c  |  218 ----
 drivers/gpu/drm/vc4/vc4_drv.c       |    6 +-
 include/drm/drm_atomic_helper.h     |    4 -
 include/drm/drm_client.h            |  117 +++
 include/drm/drm_fb_helper.h         |  127 +--
 17 files changed, 2128 insertions(+), 1539 deletions(-)
 create mode 100644 drivers/gpu/drm/drm_bootsplash.c
    
Revision 2
      This moves the modesetting code from drm_fb_helper to drm_client so it
can be shared by all internal clients.

The main change this time is to attach the modeset array to
drm_client_dev and honour the drm_fb_helper MIT license. I've dropped
the display abstraction.

Noralf.

Cc: Emmanuel Vadot <manu@bidouilliste.com>

Noralf Trønnes (12):
  drm/atomic: Move __drm_atomic_helper_disable_plane/set_config()
  drm/fb-helper: Avoid race with DRM userspace
  drm/i915/fbdev: Move intel_fb_initial_config() to fbdev helper
  drm/fb-helper: No need to cache rotation and sw_rotations
  drm/fb-helper: Remove drm_fb_helper_crtc->{x,y,desired_mode}
  drm/fb-helper: Remove drm_fb_helper_crtc
  drm/fb-helper: Prepare to move out commit code
  drm/fb-helper: Move out commit code
  drm/fb-helper: Remove drm_fb_helper_connector
  drm/fb-helper: Prepare to move out modeset config code
  drm/fb-helper: Move out modeset config code
  drm/client: Hack: Add bootsplash example

 Documentation/gpu/todo.rst           |   10 +
 drivers/gpu/drm/Kconfig              |    5 +
 drivers/gpu/drm/Makefile             |    3 +-
 drivers/gpu/drm/drm_atomic.c         |  168 ++++
 drivers/gpu/drm/drm_atomic_helper.c  |  164 ----
 drivers/gpu/drm/drm_auth.c           |   20 +
 drivers/gpu/drm/drm_bootsplash.c     |  359 ++++++++
 drivers/gpu/drm/drm_client.c         |   17 +-
 drivers/gpu/drm/drm_client_modeset.c | 1086 +++++++++++++++++++++++
 drivers/gpu/drm/drm_crtc_internal.h  |    5 +
 drivers/gpu/drm/drm_drv.c            |    4 +
 drivers/gpu/drm/drm_fb_helper.c      | 1195 +++-----------------------
 drivers/gpu/drm/drm_internal.h       |    2 +
 drivers/gpu/drm/i915/intel_fbdev.c   |  218 -----
 include/drm/drm_atomic_helper.h      |    4 -
 include/drm/drm_client.h             |   48 ++
 include/drm/drm_fb_helper.h          |  125 +--
 17 files changed, 1859 insertions(+), 1574 deletions(-)
 create mode 100644 drivers/gpu/drm/drm_bootsplash.c
 create mode 100644 drivers/gpu/drm/drm_client_modeset.c
    
Revision 3
      This moves the modesetting code from drm_fb_helper to drm_client so it
can be shared by all internal clients.

Changes this time:
- Use full drm_client_init/release for the modesets (Daniel Vetter)
- drm_client_for_each_modeset: use lockdep_assert_held (Daniel Vetter)
- Hook up to Documentation/gpu/drm-client.rst (Daniel Vetter)

Noralf.

Noralf Trønnes (11):
  drm/atomic: Move __drm_atomic_helper_disable_plane/set_config()
  drm/fb-helper: Avoid race with DRM userspace
  drm/fb-helper: No need to cache rotation and sw_rotations
  drm/fb-helper: Remove drm_fb_helper_crtc->{x,y,desired_mode}
  drm/fb-helper: Remove drm_fb_helper_crtc
  drm/fb-helper: Prepare to move out commit code
  drm/fb-helper: Move out commit code
  drm/fb-helper: Remove drm_fb_helper_connector
  drm/fb-helper: Prepare to move out modeset config code
  drm/fb-helper: Move out modeset config code
  drm/client: Hack: Add bootsplash example

 Documentation/gpu/drm-client.rst     |    3 +
 Documentation/gpu/todo.rst           |   10 +
 drivers/gpu/drm/Kconfig              |    5 +
 drivers/gpu/drm/Makefile             |    3 +-
 drivers/gpu/drm/drm_atomic.c         |  168 ++++
 drivers/gpu/drm/drm_atomic_helper.c  |  164 ---
 drivers/gpu/drm/drm_auth.c           |   20 +
 drivers/gpu/drm/drm_bootsplash.c     |  362 +++++++
 drivers/gpu/drm/drm_client.c         |   17 +-
 drivers/gpu/drm/drm_client_modeset.c | 1085 ++++++++++++++++++++
 drivers/gpu/drm/drm_crtc_internal.h  |    5 +
 drivers/gpu/drm/drm_drv.c            |    4 +
 drivers/gpu/drm/drm_fb_helper.c      | 1381 +++-----------------------
 drivers/gpu/drm/drm_internal.h       |    2 +
 include/drm/drm_atomic_helper.h      |    4 -
 include/drm/drm_client.h             |   49 +
 include/drm/drm_fb_helper.h          |  102 +-
 17 files changed, 1864 insertions(+), 1520 deletions(-)
 create mode 100644 drivers/gpu/drm/drm_bootsplash.c
 create mode 100644 drivers/gpu/drm/drm_client_modeset.c
    
Revision 4
      The Intel CI [1] was not happy with the previous version and I don't
know which part it didn't like. So I'll split up the series and feed it
piece by piece until I know where the problem is.

Noralf.

[1] https://patchwork.freedesktop.org/series/58597/

Noralf Trønnes (1):
  drm/fb-helper: Avoid race with DRM userspace

 drivers/gpu/drm/drm_auth.c      | 20 ++++++++
 drivers/gpu/drm/drm_fb_helper.c | 90 ++++++++++++++++-----------------
 drivers/gpu/drm/drm_internal.h  |  2 +
 3 files changed, 67 insertions(+), 45 deletions(-)
    
Revision 5
      This moves the modesetting code from drm_fb_helper to drm_client so it
can be shared by all internal clients.

Changes this time:
- Use restore_fbdev_mode_force() in 
  drm_fb_helper_restore_fbdev_mode_unlocked() to please igt tests. I'm not
  currently motivated to learn igt so I have added a todo entry for this.
- Rebase on drm-next (drm_fb_helper and drm_legacy patches)

Noralf.

Noralf Trønnes (11):
  drm/atomic: Move __drm_atomic_helper_disable_plane/set_config()
  drm/fb-helper: Avoid race with DRM userspace
  drm/fb-helper: No need to cache rotation and sw_rotations
  drm/fb-helper: Remove drm_fb_helper_crtc->{x,y,desired_mode}
  drm/fb-helper: Remove drm_fb_helper_crtc
  drm/fb-helper: Prepare to move out commit code
  drm/fb-helper: Move out commit code
  drm/fb-helper: Remove drm_fb_helper_connector
  drm/fb-helper: Prepare to move out modeset config code
  drm/fb-helper: Move out modeset config code
  drm/client: Hack: Add bootsplash example

 Documentation/gpu/drm-client.rst     |    3 +
 Documentation/gpu/todo.rst           |   15 +
 drivers/gpu/drm/Kconfig              |    5 +
 drivers/gpu/drm/Makefile             |    3 +-
 drivers/gpu/drm/drm_atomic.c         |  168 ++++
 drivers/gpu/drm/drm_atomic_helper.c  |  164 ---
 drivers/gpu/drm/drm_auth.c           |   20 +
 drivers/gpu/drm/drm_bootsplash.c     |  358 +++++++
 drivers/gpu/drm/drm_client.c         |   17 +-
 drivers/gpu/drm/drm_client_modeset.c | 1086 ++++++++++++++++++++
 drivers/gpu/drm/drm_crtc_internal.h  |    5 +
 drivers/gpu/drm/drm_drv.c            |    4 +
 drivers/gpu/drm/drm_fb_helper.c      | 1392 +++-----------------------
 drivers/gpu/drm/drm_internal.h       |    2 +
 include/drm/drm_atomic_helper.h      |    4 -
 include/drm/drm_client.h             |   49 +
 include/drm/drm_fb_helper.h          |  102 +-
 17 files changed, 1876 insertions(+), 1521 deletions(-)
 create mode 100644 drivers/gpu/drm/drm_bootsplash.c
 create mode 100644 drivers/gpu/drm/drm_client_modeset.c
    
Revision 6
      This moves the modesetting code from drm_fb_helper to drm_client so it
can be shared by all internal clients.

Changes this time:
- Improve commit messages

All patches have been reviewed now, thanks alot for reviewing!

Noralf.

Noralf Trønnes (8):
  drm/atomic: Move __drm_atomic_helper_disable_plane/set_config()
  drm/fb-helper: Remove drm_fb_helper_crtc
  drm/fb-helper: Prepare to move out commit code
  drm/fb-helper: Move out commit code
  drm/fb-helper: Remove drm_fb_helper_connector
  drm/fb-helper: Prepare to move out modeset config code
  drm/fb-helper: Move out modeset config code
  drm/client: Hack: Add bootsplash example

 Documentation/gpu/drm-client.rst     |    3 +
 Documentation/gpu/todo.rst           |    7 +
 drivers/gpu/drm/Kconfig              |    5 +
 drivers/gpu/drm/Makefile             |    3 +-
 drivers/gpu/drm/drm_atomic.c         |  168 ++++
 drivers/gpu/drm/drm_atomic_helper.c  |  164 ----
 drivers/gpu/drm/drm_bootsplash.c     |  358 +++++++
 drivers/gpu/drm/drm_client.c         |   17 +-
 drivers/gpu/drm/drm_client_modeset.c | 1086 +++++++++++++++++++++
 drivers/gpu/drm/drm_crtc_internal.h  |    5 +
 drivers/gpu/drm/drm_drv.c            |    4 +
 drivers/gpu/drm/drm_fb_helper.c      | 1305 ++------------------------
 include/drm/drm_atomic_helper.h      |    4 -
 include/drm/drm_client.h             |   49 +
 include/drm/drm_fb_helper.h          |   92 +-
 15 files changed, 1800 insertions(+), 1470 deletions(-)
 create mode 100644 drivers/gpu/drm/drm_bootsplash.c
 create mode 100644 drivers/gpu/drm/drm_client_modeset.c
    
Revision 7
      This moves the modesetting code from drm_fb_helper to drm_client so it
can be shared by all internal clients.

Changes this time:
- Declare drm_mode_set and drm_plane_state in patch 1
- Export drm_client_panel_rotation() (Gerd Hoffmann)
- Rebase

Noralf.

Cc: Gerd Hoffmann <kraxel@redhat.com>

Noralf Trønnes (8):
  drm/atomic: Move __drm_atomic_helper_disable_plane/set_config()
  drm/fb-helper: Remove drm_fb_helper_crtc
  drm/fb-helper: Prepare to move out commit code
  drm/fb-helper: Move out commit code
  drm/fb-helper: Remove drm_fb_helper_connector
  drm/fb-helper: Prepare to move out modeset config code
  drm/fb-helper: Move out modeset config code
  drm/client: Hack: Add bootsplash example

 Documentation/gpu/drm-client.rst     |    3 +
 Documentation/gpu/todo.rst           |    7 +
 drivers/gpu/drm/Kconfig              |    5 +
 drivers/gpu/drm/Makefile             |    3 +-
 drivers/gpu/drm/drm_atomic.c         |  168 ++++
 drivers/gpu/drm/drm_atomic_helper.c  |  164 ----
 drivers/gpu/drm/drm_bootsplash.c     |  358 +++++++
 drivers/gpu/drm/drm_client.c         |   17 +-
 drivers/gpu/drm/drm_client_modeset.c | 1087 +++++++++++++++++++++
 drivers/gpu/drm/drm_crtc_internal.h  |    7 +
 drivers/gpu/drm/drm_drv.c            |    4 +
 drivers/gpu/drm/drm_fb_helper.c      | 1305 ++------------------------
 include/drm/drm_atomic_helper.h      |    4 -
 include/drm/drm_client.h             |   49 +
 include/drm/drm_fb_helper.h          |   92 +-
 15 files changed, 1803 insertions(+), 1470 deletions(-)
 create mode 100644 drivers/gpu/drm/drm_bootsplash.c
 create mode 100644 drivers/gpu/drm/drm_client_modeset.c
    
Revision 8
      This moves the modesetting code from drm_fb_helper to drm_client so it
can be shared by all internal clients.

Let's see what the CI says about the remaining patches. I have added the
bootsplash todo entry patch adding Sam as contact.

Noralf.

Noralf Trønnes (5):
  drm/fb-helper: Remove drm_fb_helper_connector
  drm/fb-helper: Prepare to move out modeset config code
  drm/fb-helper: Move out modeset config code
  drm/client: Hack: Add bootsplash example
  drm/todo: Add bootsplash entry

 Documentation/gpu/todo.rst           |  19 +
 drivers/gpu/drm/Kconfig              |   5 +
 drivers/gpu/drm/Makefile             |   1 +
 drivers/gpu/drm/drm_bootsplash.c     | 358 +++++++++++
 drivers/gpu/drm/drm_client.c         |   7 +
 drivers/gpu/drm/drm_client_modeset.c | 707 ++++++++++++++++++++-
 drivers/gpu/drm/drm_drv.c            |   4 +
 drivers/gpu/drm/drm_fb_helper.c      | 886 +--------------------------
 include/drm/drm_client.h             |  23 +-
 include/drm/drm_fb_helper.h          |  84 +--
 10 files changed, 1149 insertions(+), 945 deletions(-)
 create mode 100644 drivers/gpu/drm/drm_bootsplash.c
    

Revisions